org.elasticsearch.index.query
Class PrefixFilterBuilder

java.lang.Object
  extended by org.elasticsearch.index.query.BaseFilterBuilder
      extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
PrefixFilterBuilder(String name, String prefix)
          A filter that restricts search results to values that have a matching prefix in a given field.
 
Method Summary
 PrefixFilterBuilder cache(boolean cache)
          Should the filter be cached or not.
 PrefixFilterBuilder cacheKey(String cacheKey)
           
 void doXContent(XContentBuilder builder, ToXContent.Params params)
           
 PrefixFilterBuilder filterName(String filterName)
          Sets the filter name for the filter that can be used when searching for matched_filters per hit.
 
Methods inherited from class org.elasticsearch.index.query.BaseFilterBuilder
toXContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixFilterBuilder

public PrefixFilterBuilder(String name,
                           String prefix)
A filter that restricts search results to values that have a matching prefix in a given field.

Parameters:
name - The field name
prefix - The prefix
Method Detail

filterName

public PrefixFilterBuilder filterName(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(String cacheKey)

doXContent

public void doXContent(XContentBuilder builder,
                       ToXContent.Params params)
                throws IOException
Specified by:
doXContent in class BaseFilterBuilder
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.