Module org.elasticsearch.server
Class StandardRetrieverBuilder
java.lang.Object
org.elasticsearch.search.retriever.RetrieverBuilder
org.elasticsearch.search.retriever.StandardRetrieverBuilder
- All Implemented Interfaces:
Rewriteable<RetrieverBuilder>
,ToXContent
A standard retriever is used to represent anything that is a query along
with some elements to specify parameters for that query.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseField
static final String
static final ObjectParser
<StandardRetrieverBuilder, RetrieverParserContext> static final ParseField
static final ParseField
static final ParseField
static final ParseField
Fields inherited from class org.elasticsearch.search.retriever.RetrieverBuilder
MIN_SCORE_FIELD, minScore, NAME_FIELD, PRE_FILTER_FIELD, preFilterQueryBuilders, rankDocs, retrieverName
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
void
doToXContent
(XContentBuilder builder, ToXContent.Params params) void
extractToSearchSourceBuilder
(SearchSourceBuilder searchSourceBuilder, boolean compoundUsed) This method is called at the end of rewriting on behalf of aSearchSourceBuilder
.static StandardRetrieverBuilder
fromXContent
(XContentParser parser, RetrieverParserContext context) getName()
Rewrites this instance based on the provided context.This function is called by compoundRetrieverBuilder
to return the original query that was used by this retriever to compute its top documents.Methods inherited from class org.elasticsearch.search.retriever.RetrieverBuilder
declareBaseParserFields, equals, explainQuery, getPreFilterQueryBuilders, getRankDocs, hashCode, isCompound, isFragment, minScore, minScore, parseInnerRetrieverBuilder, parseTopLevelRetrieverBuilder, retrieverName, retrieverName, rewritePreFilters, setRankDocs, toString, toXContent, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContent
isFragment, toXContent
-
Field Details
-
NAME
- See Also:
-
QUERY_FIELD
-
SEARCH_AFTER_FIELD
-
TERMINATE_AFTER_FIELD
-
SORT_FIELD
-
COLLAPSE_FIELD
-
PARSER
-
-
Constructor Details
-
StandardRetrieverBuilder
public StandardRetrieverBuilder() -
StandardRetrieverBuilder
-
-
Method Details
-
fromXContent
public static StandardRetrieverBuilder fromXContent(XContentParser parser, RetrieverParserContext context) throws IOException - Throws:
IOException
-
rewrite
Description copied from interface:Rewriteable
Rewrites this instance based on the provided context. The returned objects will be the same instance as this if no changes during the rewrite were applied.- Specified by:
rewrite
in interfaceRewriteable<RetrieverBuilder>
- Overrides:
rewrite
in classRetrieverBuilder
- Throws:
IOException
-
topDocsQuery
Description copied from class:RetrieverBuilder
This function is called by compoundRetrieverBuilder
to return the original query that was used by this retriever to compute its top documents.- Specified by:
topDocsQuery
in classRetrieverBuilder
-
extractToSearchSourceBuilder
public void extractToSearchSourceBuilder(SearchSourceBuilder searchSourceBuilder, boolean compoundUsed) Description copied from class:RetrieverBuilder
This method is called at the end of rewriting on behalf of aSearchSourceBuilder
. Elements from retrievers are expected to be "extracted" into theSearchSourceBuilder
.- Specified by:
extractToSearchSourceBuilder
in classRetrieverBuilder
-
getName
- Specified by:
getName
in classRetrieverBuilder
-
doToXContent
- Specified by:
doToXContent
in classRetrieverBuilder
- Throws:
IOException
-
doEquals
- Specified by:
doEquals
in classRetrieverBuilder
-
doHashCode
public int doHashCode()- Specified by:
doHashCode
in classRetrieverBuilder
-