public class CategoryContextMapping extends ContextMapping<CategoryQueryContext>
ContextMapping that uses a simple string as a criteria
The suggestions are boosted and/or filtered by their associated
category (string) value.
CategoryQueryContext defines options for constructing
a unit of query context for this context type| Modifier and Type | Class and Description |
|---|---|
static class |
CategoryContextMapping.Builder
Builder for
CategoryContextMapping |
ContextMapping.InternalQueryContext, ContextMapping.TypeToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsFIELD_NAME, FIELD_TYPE, name, typeEMPTY_PARAMS| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
protected CategoryQueryContext |
fromXContent(XContentParser parser)
Prototype for the query context
|
java.lang.String |
getFieldName()
Name of the field to get contexts from at index-time
|
int |
hashCode() |
protected static CategoryContextMapping |
load(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> config)
Loads a
named CategoryContextMapping instance
from a map. |
java.util.Set<java.lang.CharSequence> |
parseContext(ParseContext.Document document)
Retrieves a set of context from a
document at index-time. |
java.util.Set<java.lang.CharSequence> |
parseContext(ParseContext parseContext,
XContentParser parser)
Parse a set of
CharSequence contexts at index-time. |
protected XContentBuilder |
toInnerXContent(XContentBuilder builder,
ToXContent.Params params)
Implementations should add specific configurations
that need to be persisted
|
java.util.List<ContextMapping.InternalQueryContext> |
toInternalQueryContexts(java.util.List<CategoryQueryContext> queryContexts)
Parse a list of
CategoryQueryContext
using parser. |
name, parseQueryContext, toString, toXContent, typeclone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentpublic java.lang.String getFieldName()
protected static CategoryContextMapping load(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> config) throws ElasticsearchParseException
named CategoryContextMapping instance
from a map.
see ContextMappings.load(Object, Version)
Acceptable map param: pathElasticsearchParseExceptionprotected XContentBuilder toInnerXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
ContextMappingtoInnerXContent in class ContextMapping<CategoryQueryContext>java.io.IOExceptionpublic java.util.Set<java.lang.CharSequence> parseContext(ParseContext parseContext, XContentParser parser) throws java.io.IOException, ElasticsearchParseException
CharSequence contexts at index-time.
Acceptable formats:
[<string>, ..]
"string"
parseContext in class ContextMapping<CategoryQueryContext>java.io.IOExceptionElasticsearchParseExceptionpublic java.util.Set<java.lang.CharSequence> parseContext(ParseContext.Document document)
ContextMappingdocument at index-time.parseContext in class ContextMapping<CategoryQueryContext>protected CategoryQueryContext fromXContent(XContentParser parser) throws java.io.IOException
ContextMappingfromXContent in class ContextMapping<CategoryQueryContext>java.io.IOExceptionpublic java.util.List<ContextMapping.InternalQueryContext> toInternalQueryContexts(java.util.List<CategoryQueryContext> queryContexts)
CategoryQueryContext
using parser. A QueryContexts accepts one of the following forms:
[CategoryQueryContext, ..]
{"context": <string>, "boost": <int>, "prefix": <boolean>}"string"
toInternalQueryContexts in class ContextMapping<CategoryQueryContext>public boolean equals(java.lang.Object o)
equals in class ContextMapping<CategoryQueryContext>public int hashCode()
hashCode in class ContextMapping<CategoryQueryContext>