public class MoreLikeThisRequest extends ActionRequest<MoreLikeThisRequest> implements CompositeIndicesRequest
Requests.moreLikeThisRequest(String)
.
Note, the index()
, type(String)
and id(String)
are required.
TransportRequest.Empty
Constructor and Description |
---|
MoreLikeThisRequest(String index)
Constructs a new more like this request for a document that will be fetch from the provided index.
|
Modifier and Type | Method and Description |
---|---|
float |
boostTerms()
The boost factor to use when boosting terms.
|
MoreLikeThisRequest |
boostTerms(float boostTerms)
The boost factor to use when boosting terms.
|
String[] |
fields()
The fields of the document to use in order to find documents "like" this one.
|
MoreLikeThisRequest |
fields(String... fields)
The fields of the document to use in order to find documents "like" this one.
|
String |
id()
The id of document to load from which the "like" query will execute with.
|
MoreLikeThisRequest |
id(String id)
The id of document to load from which the "like" query will execute with.
|
boolean |
include()
Whether to include the queried document.
|
MoreLikeThisRequest |
include(boolean include)
Whether to include the queried document.
|
String |
index()
The index to load the document from which the "like" query will run with.
|
IndicesOptions |
indicesOptions() |
int |
maxDocFreq()
The maximum frequency in which words may still appear.
|
MoreLikeThisRequest |
maxDocFreq(int maxDocFreq)
The maximum frequency in which words may still appear.
|
int |
maxQueryTerms()
The maximum number of query terms that will be included in any generated query.
|
MoreLikeThisRequest |
maxQueryTerms(int maxQueryTerms)
The maximum number of query terms that will be included in any generated query.
|
int |
maxWordLength()
The maximum word length above which words will be ignored.
|
MoreLikeThisRequest |
maxWordLength(int maxWordLength)
The maximum word length above which words will be ignored.
|
int |
minDocFreq()
The frequency at which words will be ignored which do not occur in at least this
many docs.
|
MoreLikeThisRequest |
minDocFreq(int minDocFreq)
The frequency at which words will be ignored which do not occur in at least this
many docs.
|
String |
minimumShouldMatch()
Number of terms that must match the generated query expressed in the
common syntax for minimum should match.
|
MoreLikeThisRequest |
minimumShouldMatch(String minimumShouldMatch)
Number of terms that must match the generated query expressed in the
common syntax for minimum should match.
|
int |
minTermFreq()
The frequency below which terms will be ignored in the source doc.
|
MoreLikeThisRequest |
minTermFreq(int minTermFreq)
The frequency below which terms will be ignored in the source doc.
|
int |
minWordLength()
The minimum word length below which words will be ignored.
|
MoreLikeThisRequest |
minWordLength(int minWordLength)
The minimum word length below which words will be ignored.
|
float |
percentTermsToMatch()
Deprecated.
|
MoreLikeThisRequest |
percentTermsToMatch(float percentTermsToMatch)
Deprecated.
|
void |
readFrom(StreamInput in) |
String |
routing() |
void |
routing(String routing) |
int |
searchFrom() |
MoreLikeThisRequest |
searchFrom(int from)
From which search result set to return.
|
String[] |
searchIndices()
The indices the resulting mlt query will run against.
|
MoreLikeThisRequest |
searchIndices(String... searchIndices)
The indices the resulting mlt query will run against.
|
Scroll |
searchScroll()
An optional search scroll request to be able to continue and scroll the search
operation.
|
MoreLikeThisRequest |
searchScroll(Scroll searchScroll)
An optional search scroll request to be able to continue and scroll the search
operation.
|
int |
searchSize() |
MoreLikeThisRequest |
searchSize(int size)
The number of documents to return, defaults to 10.
|
BytesReference |
searchSource()
An optional search source request allowing to control the search request for the
more like this documents.
|
MoreLikeThisRequest |
searchSource(byte[] searchSource)
An optional search source request allowing to control the search request for the
more like this documents.
|
MoreLikeThisRequest |
searchSource(byte[] searchSource,
int offset,
int length,
boolean unsafe)
An optional search source request allowing to control the search request for the
more like this documents.
|
MoreLikeThisRequest |
searchSource(BytesReference searchSource,
boolean unsafe)
An optional search source request allowing to control the search request for the
more like this documents.
|
MoreLikeThisRequest |
searchSource(Map searchSource) |
MoreLikeThisRequest |
searchSource(SearchSourceBuilder sourceBuilder)
An optional search source request allowing to control the search request for the
more like this documents.
|
MoreLikeThisRequest |
searchSource(String searchSource)
An optional search source request allowing to control the search request for the
more like this documents.
|
MoreLikeThisRequest |
searchSource(XContentBuilder builder) |
boolean |
searchSourceUnsafe() |
SearchType |
searchType()
The search type of the mlt search query.
|
MoreLikeThisRequest |
searchType(SearchType searchType)
The search type of the mlt search query.
|
MoreLikeThisRequest |
searchType(String searchType)
The search type of the mlt search query.
|
String[] |
searchTypes()
The types the resulting mlt query will run against.
|
MoreLikeThisRequest |
searchTypes(String... searchTypes)
The types the resulting mlt query will run against.
|
String[] |
stopWords()
Any word in this set is considered "uninteresting" and ignored.
|
MoreLikeThisRequest |
stopWords(String... stopWords)
Any word in this set is considered "uninteresting" and ignored.
|
List<? extends IndicesRequest> |
subRequests()
Returns the subrequests that a composite request is composed of
|
String |
type()
The type of document to load from which the "like" query will run with.
|
MoreLikeThisRequest |
type(String type)
The type of document to load from which the "like" query will execute with.
|
ActionRequestValidationException |
validate() |
void |
writeTo(StreamOutput out) |
listenerThreaded, listenerThreaded
getHeader, getHeaders, hasHeader, putHeader, remoteAddress, remoteAddress
contextSize, copyContextFrom, getContext, getFromContext, getFromContext, hasInContext, isContextEmpty, putAllInContext, putInContext
public MoreLikeThisRequest(String index)
type(String)
and id(String)
to specify the document to load.public String index()
public String type()
public IndicesOptions indicesOptions()
public List<? extends IndicesRequest> subRequests()
CompositeIndicesRequest
subRequests
in interface CompositeIndicesRequest
public MoreLikeThisRequest type(String type)
public String id()
public MoreLikeThisRequest id(String id)
public String routing()
public void routing(String routing)
public String[] fields()
public MoreLikeThisRequest fields(String... fields)
public MoreLikeThisRequest minimumShouldMatch(String minimumShouldMatch)
public String minimumShouldMatch()
@Deprecated public MoreLikeThisRequest percentTermsToMatch(float percentTermsToMatch)
@Deprecated public float percentTermsToMatch()
public MoreLikeThisRequest minTermFreq(int minTermFreq)
public int minTermFreq()
public MoreLikeThisRequest maxQueryTerms(int maxQueryTerms)
public int maxQueryTerms()
public MoreLikeThisRequest stopWords(String... stopWords)
Even if your Analyzer allows stopwords, you might want to tell the MoreLikeThis code to ignore them, as for the purposes of document similarity it seems reasonable to assume that "a stop word is never interesting".
Defaults to no stop words.
public String[] stopWords()
Even if your Analyzer allows stopwords, you might want to tell the MoreLikeThis code to ignore them, as for the purposes of document similarity it seems reasonable to assume that "a stop word is never interesting".
Defaults to no stop words.
public MoreLikeThisRequest minDocFreq(int minDocFreq)
public int minDocFreq()
public MoreLikeThisRequest maxDocFreq(int maxDocFreq)
public int maxDocFreq()
public MoreLikeThisRequest minWordLength(int minWordLength)
public int minWordLength()
public MoreLikeThisRequest maxWordLength(int maxWordLength)
public int maxWordLength()
public MoreLikeThisRequest boostTerms(float boostTerms)
public float boostTerms()
public MoreLikeThisRequest include(boolean include)
public boolean include()
public MoreLikeThisRequest searchSource(SearchSourceBuilder sourceBuilder)
public MoreLikeThisRequest searchSource(String searchSource)
public MoreLikeThisRequest searchSource(Map searchSource)
public MoreLikeThisRequest searchSource(XContentBuilder builder)
public MoreLikeThisRequest searchSource(byte[] searchSource)
public MoreLikeThisRequest searchSource(byte[] searchSource, int offset, int length, boolean unsafe)
public MoreLikeThisRequest searchSource(BytesReference searchSource, boolean unsafe)
public BytesReference searchSource()
public boolean searchSourceUnsafe()
public MoreLikeThisRequest searchType(SearchType searchType)
public MoreLikeThisRequest searchType(String searchType) throws ElasticsearchIllegalArgumentException
public SearchType searchType()
public MoreLikeThisRequest searchIndices(String... searchIndices)
public String[] searchIndices()
public MoreLikeThisRequest searchTypes(String... searchTypes)
public String[] searchTypes()
public MoreLikeThisRequest searchScroll(Scroll searchScroll)
public Scroll searchScroll()
public MoreLikeThisRequest searchSize(int size)
public int searchSize()
public MoreLikeThisRequest searchFrom(int from)
public int searchFrom()
public ActionRequestValidationException validate()
validate
in class ActionRequest<MoreLikeThisRequest>
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
readFrom
in class ActionRequest<MoreLikeThisRequest>
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
writeTo
in class ActionRequest<MoreLikeThisRequest>
IOException
Copyright © 2009–2015. All rights reserved.