org.elasticsearch.index.query
Class PrefixQueryBuilder

java.lang.Object
  extended by org.elasticsearch.index.query.BaseQueryBuilder
      extended by org.elasticsearch.index.query.PrefixQueryBuilder
All Implemented Interfaces:
ToXContent, BoostableQueryBuilder<PrefixQueryBuilder>, QueryBuilder

public class PrefixQueryBuilder
extends BaseQueryBuilder
implements BoostableQueryBuilder<PrefixQueryBuilder>

A Query that matches documents containing terms with a specified prefix.


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
PrefixQueryBuilder(String name, String prefix)
          A Query that matches documents containing terms with a specified prefix.
 
Method Summary
 PrefixQueryBuilder boost(float boost)
          Sets the boost for this query.
 void doXContent(XContentBuilder builder, ToXContent.Params params)
           
 PrefixQueryBuilder rewrite(String rewrite)
           
 
Methods inherited from class org.elasticsearch.index.query.BaseQueryBuilder
buildAsBytes, buildAsBytes, toString, toXContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrefixQueryBuilder

public PrefixQueryBuilder(String name,
                          String prefix)
A Query that matches documents containing terms with a specified prefix.

Parameters:
name - The name of the field
prefix - The prefix query
Method Detail

boost

public PrefixQueryBuilder boost(float boost)
Sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided.

Specified by:
boost in interface BoostableQueryBuilder<PrefixQueryBuilder>

rewrite

public PrefixQueryBuilder rewrite(String rewrite)

doXContent

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


Copyright © 2009-2012. All Rights Reserved.