public interface Query
Modifier and Type | Interface and Description |
---|---|
static class |
Query.SearchType |
Modifier and Type | Field and Description |
---|---|
static Pageable |
DEFAULT_PAGE |
static int |
DEFAULT_PAGE_SIZE |
Modifier and Type | Method and Description |
---|---|
void |
addFields(String... fields)
Add fields to be added as part of search request
|
void |
addRescorerQuery(RescorerQuery rescorerQuery)
Adds a
RescorerQuery . |
<T extends Query> |
addSort(Sort sort)
Add
Sort to query |
void |
addSourceFilter(SourceFilter sourceFilter)
Add source filter to be added as part of search request
|
static Query |
findAll()
Get a
Query that matches all documents in the index. |
default boolean |
getExplain() |
List<String> |
getFields()
Get fields to be returned as part of search request
|
default Optional<HighlightQuery> |
getHighlightQuery() |
Collection<String> |
getIds()
Get Ids
|
IndicesOptions |
getIndicesOptions()
Get indices options
|
default Integer |
getMaxResults()
return the max of results.
|
float |
getMinScore()
Get minimum score
|
Pageable |
getPageable()
Get page settings if defined
|
String |
getPreference()
Get preference
|
Boolean |
getRequestCache() |
default List<RescorerQuery> |
getRescorerQueries()
get the list of
RescorerQuery s |
String |
getRoute()
Get route
|
Duration |
getScrollTime()
For queries that are used in delete request, these are internally handled by Elasticsearch as scroll/bulk delete
queries.
|
List<Object> |
getSearchAfter() |
Query.SearchType |
getSearchType()
Type of search
|
Sort |
getSort() |
SourceFilter |
getSourceFilter()
Get SourceFilter to be returned to get include and exclude source fields as part of search request.
|
Duration |
getTimeout()
Get the query timeout.
|
boolean |
getTrackScores()
Get if scores will be computed and tracked, regardless of whether sorting on a field.
|
Boolean |
getTrackTotalHits()
Sets the flag whether to set the Track_total_hits parameter on queries Elasticseacrh
documentation>
|
Integer |
getTrackTotalHitsUpTo()
Gets the maximum value up to which total hits are tracked.
|
default boolean |
hasScrollTime() |
default boolean |
isLimiting() |
void |
setFields(List<String> fields)
Set fields to be returned as part of search request
|
void |
setHighlightQuery(HighlightQuery highlightQuery)
Sets the
HighlightQuery . |
<T extends Query> |
setPageable(Pageable pageable)
restrict result to entries on given page.
|
void |
setPreference(String preference)
Add preference filter to be added as part of search request
|
void |
setRequestCache(Boolean value)
sets the request_cache value for the query.
|
void |
setRescorerQueries(List<RescorerQuery> rescorerQueryList)
Sets the
RescorerQuery . |
void |
setScrollTime(Duration scrollTime)
For queries that are used in delete request, these are internally handled by Elasticsearch as scroll/bulk delete
queries.
|
void |
setSearchAfter(List<Object> searchAfter)
Sets the setSearchAfter objects for this query.
|
void |
setTrackTotalHits(Boolean trackTotalHits)
Sets the flag whether to set the Track_total_hits parameter on queries Elasticseacrh
documentation>
|
void |
setTrackTotalHitsUpTo(Integer trackTotalHitsUpTo)
Sets the maximum value up to which total hits are tracked.
|
static final int DEFAULT_PAGE_SIZE
static final Pageable DEFAULT_PAGE
static Query findAll()
Query
that matches all documents in the index.Query
.<T extends Query> T setPageable(Pageable pageable)
pageable
- Pageable getPageable()
void addFields(String... fields)
fields
- List<String> getFields()
void setFields(List<String> fields)
fields
- must not be nullvoid addSourceFilter(SourceFilter sourceFilter)
sourceFilter
- @Nullable SourceFilter getSourceFilter()
float getMinScore()
boolean getTrackScores()
@Nullable Collection<String> getIds()
Query.SearchType getSearchType()
@Nullable IndicesOptions getIndicesOptions()
void setPreference(String preference)
preference
- default boolean isLimiting()
@Nullable default Integer getMaxResults()
isLimiting()
returns true.void setHighlightQuery(HighlightQuery highlightQuery)
HighlightQuery
.highlightQuery
- the query to setdefault Optional<HighlightQuery> getHighlightQuery()
HighlightQuery
.void setTrackTotalHits(@Nullable Boolean trackTotalHits)
trackTotalHits
- the value to set.@Nullable Boolean getTrackTotalHits()
void setTrackTotalHitsUpTo(@Nullable Integer trackTotalHitsUpTo)
trackTotalHitsUpTo
- max limit for trackTotalHits@Nullable Integer getTrackTotalHitsUpTo()
@Nullable Duration getScrollTime()
hasScrollTime()
returns true.void setScrollTime(@Nullable Duration scrollTime)
scrollTime
- the scrolltime settingsdefault boolean hasScrollTime()
@Nullable Duration getTimeout()
default boolean getExplain()
void setSearchAfter(@Nullable List<Object> searchAfter)
searchAfter
- the setSearchAfter objects. These are obtained with SearchHit.getSortValues()
from a
search result.@Nullable List<Object> getSearchAfter()
void addRescorerQuery(RescorerQuery rescorerQuery)
RescorerQuery
.rescorerQuery
- the query to add to the list of rescorer queries, must not be nullvoid setRescorerQueries(List<RescorerQuery> rescorerQueryList)
RescorerQuery
.rescorerQueryList
- list of rescorer queries set, must not be null.default List<RescorerQuery> getRescorerQueries()
RescorerQuery
svoid setRequestCache(@Nullable Boolean value)
value
- new valueCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.