org.elasticsearch.index.query.xcontent
Class WildcardQueryBuilder
java.lang.Object
org.elasticsearch.index.query.xcontent.BaseQueryBuilder
org.elasticsearch.index.query.xcontent.WildcardQueryBuilder
- All Implemented Interfaces:
- QueryBuilder, XContentQueryBuilder, ToXContent
public class WildcardQueryBuilder
- extends BaseQueryBuilder
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
?.
Constructor Summary |
WildcardQueryBuilder(java.lang.String name,
java.lang.String wildcard)
Implements the wildcard search query. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WildcardQueryBuilder
public WildcardQueryBuilder(java.lang.String name,
java.lang.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
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.
doXContent
public void doXContent(XContentBuilder builder,
ToXContent.Params params)
throws java.io.IOException
- Specified by:
doXContent
in class BaseQueryBuilder
- Throws:
java.io.IOException