Package sonia.scm.search
Class QueryBuilder<T>
java.lang.Object
sonia.scm.search.QueryBuilder<T>
- Type Parameters:
- T- type of indexed objects
Build and execute queries against an index.
- Since:
- 2.21.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionExecutes the query and returns the total count of hits.protected QueryCountResultcount(sonia.scm.search.QueryBuilder.QueryParams queryParams) Executes the query and returns the total count of hits.Executes the query and returns the matches.protected abstract QueryResultexecute(sonia.scm.search.QueryBuilder.QueryParams queryParams) Executes the query and returns the matches.Return only results which are related to the given part of the id.filter(Class<?> type, ModelObject idObject) Return only results which are related to the given part of the id.filter(Repository repository) Return only results which are related to the given repository.limit(int limit) Defines how many hits are returned.start(int start) The result should start at the given number.
- 
Constructor Details- 
QueryBuilderpublic QueryBuilder()
 
- 
- 
Method Details- 
filterReturn only results which are related to the given part of the id. Note: this function can be called multiple times.- Parameters:
- type- type of id part
- id- value of id part
- Returns:
- this
- Since:
- 2.23.0
- See Also:
 
- 
filterReturn only results which are related to the given repository.- Parameters:
- repository- repository for filter
- Returns:
- this
- Since:
- 2.23.0
- See Also:
 
- 
filterReturn only results which are related to the given part of the id. Note: this function can be called multiple times.- Parameters:
- type- type of id part
- idObject- object which holds the id value
- Returns:
- this
- Since:
- 2.23.0
- See Also:
 
- 
startThe result should start at the given number. All matching objects before the given start are skipped.- Parameters:
- start- start of result
- Returns:
- this
 
- 
limitDefines how many hits are returned.- Parameters:
- limit- limit of hits
- Returns:
- this
 
- 
executeExecutes the query and returns the matches.- Parameters:
- queryString- searched query
- Returns:
- result of query
 
- 
countExecutes the query and returns the total count of hits.- Parameters:
- queryString- searched query
- Returns:
- total count of hits
- Since:
- 2.22.0
 
- 
executeExecutes the query and returns the matches.- Parameters:
- queryParams- query parameter
- Returns:
- result of query
 
- 
countExecutes the query and returns the total count of hits.- Parameters:
- queryParams- query parameter
- Returns:
- total hit count
- Since:
- 2.22.0
 
 
-