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 java.lang.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(java.lang.String index, java.lang.String type, java.lang.String id)
Constructor for a given item / document requestItem(java.lang.String index, java.lang.String type, XContentBuilder doc)
Constructor for an artificial document request, that is not present in the index.
-
Method Summary
Modifier and Type Method Description BytesReference
doc()
boolean
equals(java.lang.Object o)
java.lang.String[]
fields()
MoreLikeThisQueryBuilder.Item
fields(java.lang.String... fields)
int
hashCode()
java.lang.String
id()
java.lang.String
index()
MoreLikeThisQueryBuilder.Item
index(java.lang.String index)
static MoreLikeThisQueryBuilder.Item
parse(XContentParser parser, MoreLikeThisQueryBuilder.Item item)
Parses and returns the given item.java.util.Map<java.lang.String,java.lang.String>
perFieldAnalyzer()
MoreLikeThisQueryBuilder.Item
perFieldAnalyzer(java.util.Map<java.lang.String,java.lang.String> perFieldAnalyzer)
Sets the analyzer(s) to use at any given field.java.lang.String
routing()
MoreLikeThisQueryBuilder.Item
routing(java.lang.String routing)
java.lang.String
toString()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
java.lang.String
type()
MoreLikeThisQueryBuilder.Item
type(java.lang.String type)
long
version()
MoreLikeThisQueryBuilder.Item
version(long version)
VersionType
versionType()
MoreLikeThisQueryBuilder.Item
versionType(VersionType versionType)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.-
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 java.lang.String index, @Nullable java.lang.String type, java.lang.String id)
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
public Item(@Nullable java.lang.String index, @Nullable java.lang.String type, 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 doctype
- the type to be used for parsing the docdoc
- the document specification
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.
-
index
public java.lang.String index()
-
index
public MoreLikeThisQueryBuilder.Item index(java.lang.String index)
-
type
public java.lang.String type()
-
type
public MoreLikeThisQueryBuilder.Item type(java.lang.String type)
-
id
public java.lang.String id()
-
doc
public BytesReference doc()
-
fields
public java.lang.String[] fields()
-
fields
public MoreLikeThisQueryBuilder.Item fields(java.lang.String... 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
public MoreLikeThisQueryBuilder.Item routing(java.lang.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 java.io.IOException
Parses and returns the given item.- Throws:
java.io.IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-