org.elasticsearch.index.query
Class PrefixFilterBuilder
java.lang.Object
org.elasticsearch.index.query.BaseFilterBuilder
org.elasticsearch.index.query.PrefixFilterBuilder
- All Implemented Interfaces:
- ToXContent, FilterBuilder
public class PrefixFilterBuilder
- extends BaseFilterBuilder
A filter that restricts search results to values that have a matching prefix in a given
field.
Constructor Summary |
PrefixFilterBuilder(java.lang.String name,
java.lang.String prefix)
A filter that restricts search results to values that have a matching prefix in a given
field. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PrefixFilterBuilder
public PrefixFilterBuilder(java.lang.String name,
java.lang.String prefix)
- A filter that restricts search results to values that have a matching prefix in a given
field.
- Parameters:
name
- The field nameprefix
- The prefix
filterName
public PrefixFilterBuilder filterName(java.lang.String filterName)
- Sets the filter name for the filter that can be used when searching for matched_filters per hit.
cache
public PrefixFilterBuilder cache(boolean cache)
- Should the filter be cached or not. Defaults to false.
cacheKey
public PrefixFilterBuilder cacheKey(java.lang.String cacheKey)
doXContent
public void doXContent(XContentBuilder builder,
ToXContent.Params params)
throws java.io.IOException
- Specified by:
doXContent
in class BaseFilterBuilder
- Throws:
java.io.IOException