@Service @Validated public class SearchService extends Object
Constructor and Description |
---|
SearchService(ESClient esClient) |
Modifier and Type | Method and Description |
---|---|
SearchHitDTO |
findById(String indexName,
String typeName,
String id)
Searches for a document matching the given arguments.
|
ScrollRequest |
prepareScroll(String indexName,
QueryMatch query,
int maxResults)
Creates a ScrollRequest that can be used for searches with large results ("page" type
results).
|
SearchResultDTO |
scroll(ScrollRequest scrollRequest)
Performs a search that may have more than one results
|
SearchResultDTO |
search(QuerySpec dto)
Searches for documents matching the given Query.
|
@Autowired public SearchService(ESClient esClient)
public SearchResultDTO search(QuerySpec dto)
dto
- contains the query information needed to proceed with the searchpublic SearchHitDTO findById(String indexName, String typeName, String id)
indexName
- the name of the index that the document is part oftypeName
- the name of the index type that the document is part ofid
- the id of the documentpublic ScrollRequest prepareScroll(String indexName, QueryMatch query, int maxResults)
indexName
- the name of the index that the search will be performedquery
- the query of the searchmaxResults
- the maximum number of hitList to be returned with each batch of resultspublic SearchResultDTO scroll(ScrollRequest scrollRequest)
scrollRequest
- contains the search query and the multi-result configurationCopyright © 2020. All rights reserved.