Package org.elasticsearch.index.query
Class MoreLikeThisQueryBuilder.Item
- java.lang.Object
-
- org.elasticsearch.index.query.MoreLikeThisQueryBuilder.Item
-
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
- Enclosing class:
- MoreLikeThisQueryBuilder
public static final class MoreLikeThisQueryBuilder.Item extends Object implements ToXContentObject, Writeable
A single item to be used for aMoreLikeThisQueryBuilder.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested 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-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description Item()Item(String index, String id)Constructor for a given item / document requestItem(String index, String type, String id)Deprecated.Types are in the process of being removed, useItem(java.lang.String,java.lang.String)instead.Item(String index, String type, XContentBuilder doc)Deprecated.Types are in the process of being removed, useItem(java.lang.String,org.elasticsearch.common.xcontent.XContentBuilder)instead.Item(String index, XContentBuilder doc)Constructor for an artificial document request, that is not present in the index.
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
EMPTY_ARRAY
public static final MoreLikeThisQueryBuilder.Item[] EMPTY_ARRAY
-
-
Constructor Detail
-
Item
public Item()
-
Item
public Item(@Nullable String index, 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 String index, 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 String index, @Nullable String type, 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 String index, @Nullable String type, 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 Detail
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
index
public String index()
-
index
public MoreLikeThisQueryBuilder.Item index(String index)
-
type
@Deprecated public String type()
Deprecated.Types are in the process of being removed.
-
type
@Deprecated public MoreLikeThisQueryBuilder.Item type(String type)
Deprecated.Types are in the process of being removed.
-
id
public String id()
-
doc
public BytesReference doc()
-
fields
public String[] fields()
-
fields
public MoreLikeThisQueryBuilder.Item fields(String... fields)
-
perFieldAnalyzer
public MoreLikeThisQueryBuilder.Item perFieldAnalyzer(Map<String,String> perFieldAnalyzer)
Sets the analyzer(s) to use at any given field.
-
routing
public String routing()
-
routing
public MoreLikeThisQueryBuilder.Item routing(String routing)
-
version
public long version()
-
version
public MoreLikeThisQueryBuilder.Item version(long version)
-
versionType
public VersionType versionType()
-
versionType
public MoreLikeThisQueryBuilder.Item versionType(VersionType versionType)
-
parse
public static MoreLikeThisQueryBuilder.Item parse(XContentParser parser, MoreLikeThisQueryBuilder.Item item) throws IOException
Parses and returns the given item.- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
-