Class MoreLikeThisQuery.Builder
- All Implemented Interfaces:
WithJson<MoreLikeThisQuery.Builder>
,ObjectBuilder<MoreLikeThisQuery>
- Enclosing class:
- MoreLikeThisQuery
MoreLikeThisQuery
.-
Constructor Summary
-
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 (text
orkeyword
).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:routing
protected MoreLikeThisQuery.Builder
self()
An array of stop words.An array of stop words.Used in combination withlike
to exclude documents that match a set of terms.Used in combination withlike
to exclude documents that match a set of terms.Used in combination withlike
to exclude documents that match a set of terms.API name:version
versionType
(VersionType value) API name:version_type
Methods inherited from class co.elastic.clients.elasticsearch._types.query_dsl.QueryBase.AbstractBuilder
boost, queryName
Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods 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 (text
orkeyword
).API name:
fail_on_unsupported_field
-
fields
A list of fields to fetch and analyze the text from. Defaults to theindex.query.default_field
index setting, which has a default value of*
.API name:
fields
Adds all elements of
list
tofields
. -
fields
A list of fields to fetch and analyze the text from. Defaults to theindex.query.default_field
index setting, which has a default value of*
.API name:
fields
Adds 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:
like
Adds all elements of
list
tolike
. -
like
Required - Specifies free form text and/or a single or multiple documents for which you want to find similar documents.API name:
like
Adds 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:
like
Adds a value to
like
using 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_analyzer
Adds all entries of
map
toperFieldAnalyzer
. -
perFieldAnalyzer
Overrides the default analyzer.API name:
per_field_analyzer
Adds an entry to
perFieldAnalyzer
. -
routing
API name:routing
-
stopWords
An array of stop words. Any word in this set is ignored.API name:
stop_words
Adds all elements of
list
tostopWords
. -
stopWords
An array of stop words. Any word in this set is ignored.API name:
stop_words
Adds one or more values to
stopWords
. -
unlike
Used in combination withlike
to exclude documents that match a set of terms.API name:
unlike
Adds all elements of
list
tounlike
. -
unlike
Used in combination withlike
to exclude documents that match a set of terms.API name:
unlike
Adds one or more values to
unlike
. -
unlike
Used in combination withlike
to exclude documents that match a set of terms.API name:
unlike
Adds a value to
unlike
using a builder lambda. -
version
API name:version
-
versionType
API name:version_type
-
self
- Specified by:
self
in classQueryBase.AbstractBuilder<MoreLikeThisQuery.Builder>
-
build
Builds aMoreLikeThisQuery
.- Specified by:
build
in interfaceObjectBuilder<MoreLikeThisQuery>
- Throws:
NullPointerException
- if some of the required fields are null.
-