Class MoreLikeThisQuery.Builder
- All Implemented Interfaces:
WithJson<MoreLikeThisQuery.Builder>,ObjectBuilder<MoreLikeThisQuery>
- Enclosing class:
- MoreLikeThisQuery
MoreLikeThisQuery.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe analyzer that is used to analyze the free form text.boostTerms(Double value) Each term in the formed query could be further boosted by their tf-idf score.build()Builds aMoreLikeThisQuery.failOnUnsupportedField(Boolean value) Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (textorkeyword).A list of fields to fetch and analyze the text from.A list of fields to fetch and analyze the text from.Specifies whether the input documents should also be included in the search results returned.Required - Specifies free form text and/or a single or multiple documents for which you want to find similar documents.Required - Specifies free form text and/or a single or multiple documents for which you want to find similar documents.Required - Specifies free form text and/or a single or multiple documents for which you want to find similar documents.maxDocFreq(Integer value) The maximum document frequency above which the terms are ignored from the input document.maxQueryTerms(Integer value) The maximum number of query terms that can be selected.maxWordLength(Integer value) The maximum word length above which the terms are ignored.minDocFreq(Integer value) The minimum document frequency below which the terms are ignored from the input document.minimumShouldMatch(String value) After the disjunctive query has been formed, this parameter controls the number of terms that must match.minTermFreq(Integer value) The minimum term frequency below which the terms are ignored from the input document.minWordLength(Integer value) The minimum word length below which the terms are ignored.perFieldAnalyzer(String key, String value) Overrides the default analyzer.perFieldAnalyzer(Map<String, String> map) Overrides the default analyzer.API name:routingprotected MoreLikeThisQuery.Builderself()An array of stop words.An array of stop words.Used in combination withliketo exclude documents that match a set of terms.Used in combination withliketo exclude documents that match a set of terms.Used in combination withliketo exclude documents that match a set of terms.API name:versionversionType(VersionType value) API name:version_typeMethods inherited from class co.elastic.clients.elasticsearch._types.query_dsl.QueryBase.AbstractBuilder
boost, queryNameMethods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
analyzer
The analyzer that is used to analyze the free form text. Defaults to the analyzer associated with the first field in fields.API name:
analyzer -
boostTerms
Each term in the formed query could be further boosted by their tf-idf score. This sets the boost factor to use when using this feature. Defaults to deactivated (0).API name:
boost_terms -
failOnUnsupportedField
Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (textorkeyword).API name:
fail_on_unsupported_field -
fields
A list of fields to fetch and analyze the text from. Defaults to theindex.query.default_fieldindex setting, which has a default value of*.API name:
fieldsAdds all elements of
listtofields. -
fields
A list of fields to fetch and analyze the text from. Defaults to theindex.query.default_fieldindex setting, which has a default value of*.API name:
fieldsAdds one or more values to
fields. -
include
Specifies whether the input documents should also be included in the search results returned.API name:
include -
like
Required - Specifies free form text and/or a single or multiple documents for which you want to find similar documents.API name:
likeAdds all elements of
listtolike. -
like
Required - Specifies free form text and/or a single or multiple documents for which you want to find similar documents.API name:
likeAdds one or more values to
like. -
like
Required - Specifies free form text and/or a single or multiple documents for which you want to find similar documents.API name:
likeAdds a value to
likeusing a builder lambda. -
maxDocFreq
The maximum document frequency above which the terms are ignored from the input document.API name:
max_doc_freq -
maxQueryTerms
The maximum number of query terms that can be selected.API name:
max_query_terms -
maxWordLength
The maximum word length above which the terms are ignored. Defaults to unbounded (0).API name:
max_word_length -
minDocFreq
The minimum document frequency below which the terms are ignored from the input document.API name:
min_doc_freq -
minimumShouldMatch
After the disjunctive query has been formed, this parameter controls the number of terms that must match.API name:
minimum_should_match -
minTermFreq
The minimum term frequency below which the terms are ignored from the input document.API name:
min_term_freq -
minWordLength
The minimum word length below which the terms are ignored.API name:
min_word_length -
perFieldAnalyzer
Overrides the default analyzer.API name:
per_field_analyzerAdds all entries of
maptoperFieldAnalyzer. -
perFieldAnalyzer
Overrides the default analyzer.API name:
per_field_analyzerAdds an entry to
perFieldAnalyzer. -
routing
API name:routing -
stopWords
An array of stop words. Any word in this set is ignored.API name:
stop_wordsAdds all elements of
listtostopWords. -
stopWords
An array of stop words. Any word in this set is ignored.API name:
stop_wordsAdds one or more values to
stopWords. -
unlike
Used in combination withliketo exclude documents that match a set of terms.API name:
unlikeAdds all elements of
listtounlike. -
unlike
Used in combination withliketo exclude documents that match a set of terms.API name:
unlikeAdds one or more values to
unlike. -
unlike
Used in combination withliketo exclude documents that match a set of terms.API name:
unlikeAdds a value to
unlikeusing a builder lambda. -
version
API name:version -
versionType
API name:version_type -
self
- Specified by:
selfin classQueryBase.AbstractBuilder<MoreLikeThisQuery.Builder>
-
build
Builds aMoreLikeThisQuery.- Specified by:
buildin interfaceObjectBuilder<MoreLikeThisQuery>- Throws:
NullPointerException- if some of the required fields are null.
-