org.elasticsearch.index.query
Class WildcardQueryBuilder
java.lang.Object
org.elasticsearch.index.query.BaseQueryBuilder
org.elasticsearch.index.query.WildcardQueryBuilder
- All Implemented Interfaces:
- ToXContent, BoostableQueryBuilder<WildcardQueryBuilder>, QueryBuilder
public class WildcardQueryBuilder
- extends BaseQueryBuilder
- implements BoostableQueryBuilder<WildcardQueryBuilder>
Implements the wildcard search query. Supported wildcards are *, which
matches any character sequence (including the empty one), and ?,
which matches any single character. Note this query can be slow, as it
needs to iterate over many terms. In order to prevent extremely slow WildcardQueries,
a Wildcard term should not start with one of the wildcards * or
?.
WildcardQueryBuilder
public WildcardQueryBuilder(String name,
String wildcard)
- Implements the wildcard search query. Supported wildcards are *, which
matches any character sequence (including the empty one), and ?,
which matches any single character. Note this query can be slow, as it
needs to iterate over many terms. In order to prevent extremely slow WildcardQueries,
a Wildcard term should not start with one of the wildcards * or
?.
- Parameters:
name
- The field namewildcard
- The wildcard query string
rewrite
public WildcardQueryBuilder rewrite(String rewrite)
boost
public WildcardQueryBuilder 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<WildcardQueryBuilder>
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.