Package org.elasticsearch.index.query
Class MoreLikeThisQueryBuilder.Item
java.lang.Object
org.elasticsearch.index.query.MoreLikeThisQueryBuilder.Item
- All Implemented Interfaces:
Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentObject
- Enclosing class:
- MoreLikeThisQueryBuilder
public static final class MoreLikeThisQueryBuilder.Item extends java.lang.Object implements org.elasticsearch.common.xcontent.ToXContentObject, Writeable
A single item to be used for a
MoreLikeThisQueryBuilder.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields Modifier and Type Field Description static MoreLikeThisQueryBuilder.Item[]EMPTY_ARRAY -
Constructor Summary
Constructors Constructor Description Item()Item(java.lang.String index, java.lang.String id)Constructor for a given item / document requestItem(java.lang.String index, java.lang.String type, java.lang.String id)Deprecated.Types are in the process of being removed, useItem(java.lang.String,java.lang.String)instead.Item(java.lang.String index, java.lang.String type, org.elasticsearch.common.xcontent.XContentBuilder doc)Deprecated.Types are in the process of being removed, useItem(java.lang.String,org.elasticsearch.common.xcontent.XContentBuilder)instead.Item(java.lang.String index, org.elasticsearch.common.xcontent.XContentBuilder doc)Constructor for an artificial document request, that is not present in the index. -
Method Summary
Modifier and Type Method Description BytesReferencedoc()booleanequals(java.lang.Object o)java.lang.String[]fields()MoreLikeThisQueryBuilder.Itemfields(java.lang.String... fields)inthashCode()java.lang.Stringid()java.lang.Stringindex()MoreLikeThisQueryBuilder.Itemindex(java.lang.String index)static MoreLikeThisQueryBuilder.Itemparse(org.elasticsearch.common.xcontent.XContentParser parser, MoreLikeThisQueryBuilder.Item item)Parses and returns the given item.java.util.Map<java.lang.String,java.lang.String>perFieldAnalyzer()MoreLikeThisQueryBuilder.ItemperFieldAnalyzer(java.util.Map<java.lang.String,java.lang.String> perFieldAnalyzer)Sets the analyzer(s) to use at any given field.java.lang.Stringrouting()MoreLikeThisQueryBuilder.Itemrouting(java.lang.String routing)java.lang.StringtoString()org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)java.lang.Stringtype()Deprecated.Types are in the process of being removed.MoreLikeThisQueryBuilder.Itemtype(java.lang.String type)Deprecated.Types are in the process of being removed.longversion()MoreLikeThisQueryBuilder.Itemversion(long version)VersionTypeversionType()MoreLikeThisQueryBuilder.ItemversionType(VersionType versionType)voidwriteTo(StreamOutput out)Write this into the StreamOutput.
-
Field Details
-
Constructor Details
-
Item
public Item() -
Item
public Item(@Nullable java.lang.String index, java.lang.String id)Constructor for a given item / document request- Parameters:
index- the index where the document is locatedid- and its id
-
Item
public Item(@Nullable java.lang.String index, org.elasticsearch.common.xcontent.XContentBuilder doc)Constructor for an artificial document request, that is not present in the index.- Parameters:
index- the index to be used for parsing the docdoc- the document specification
-
Item
@Deprecated public Item(@Nullable java.lang.String index, @Nullable java.lang.String type, java.lang.String id)Deprecated.Types are in the process of being removed, useItem(java.lang.String,java.lang.String)instead.Constructor for a given item / document request- Parameters:
index- the index where the document is locatedtype- the type of the documentid- and its id
-
Item
@Deprecated public Item(@Nullable java.lang.String index, @Nullable java.lang.String type, org.elasticsearch.common.xcontent.XContentBuilder doc)Deprecated.Types are in the process of being removed, useItem(java.lang.String,org.elasticsearch.common.xcontent.XContentBuilder)instead.Constructor for an artificial document request, that is not present in the index.- Parameters:
index- the index to be used for parsing the doctype- the type to be used for parsing the docdoc- the document specification
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput. -
index
public java.lang.String index() -
index
-
type
@Deprecated public java.lang.String type()Deprecated.Types are in the process of being removed. -
type
Deprecated.Types are in the process of being removed. -
id
public java.lang.String id() -
doc
-
fields
public java.lang.String[] fields() -
fields
-
perFieldAnalyzer
public java.util.Map<java.lang.String,java.lang.String> perFieldAnalyzer() -
perFieldAnalyzer
public MoreLikeThisQueryBuilder.Item perFieldAnalyzer(java.util.Map<java.lang.String,java.lang.String> perFieldAnalyzer)Sets the analyzer(s) to use at any given field. -
routing
public java.lang.String routing() -
routing
-
version
public long version() -
version
-
versionType
-
versionType
-
parse
public static MoreLikeThisQueryBuilder.Item parse(org.elasticsearch.common.xcontent.XContentParser parser, MoreLikeThisQueryBuilder.Item item) throws java.io.IOExceptionParses and returns the given item.- Throws:
java.io.IOException
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceorg.elasticsearch.common.xcontent.ToXContent- Throws:
java.io.IOException
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-