public class WildcardQuery extends org.apache.lucene.search.Query implements Transformable
Wildcards are:
%
: matches zero or more characters_
: matches exactly one characterTRANSFORM_LOWER_CASE, TRANSFORM_NONE, TRANSFORM_UPPER_CASE
Constructor and Description |
---|
WildcardQuery(String field,
String propName,
String pattern,
int transform,
org.apache.jackrabbit.core.query.lucene.PerQueryCache cache)
Creates a new
WildcardQuery . |
WildcardQuery(String field,
String propName,
String pattern,
org.apache.jackrabbit.core.query.lucene.PerQueryCache cache)
Creates a new
WildcardQuery . |
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.search.Weight |
createWeight(org.apache.lucene.search.Searcher searcher)
Creates the
Weight for this query. |
void |
extractTerms(Set<org.apache.lucene.index.Term> terms) |
org.apache.lucene.search.Query |
rewrite(org.apache.lucene.index.IndexReader reader)
Either rewrites this query to a lucene MultiTermQuery or in case of
a TooManyClauses exception to a custom jackrabbit query implementation
that uses a BitSet to collect all hits.
|
void |
setTransformation(int transformation)
Sets the transformation.
|
String |
toString(String field)
Returns a string representation of this query.
|
public WildcardQuery(String field, String propName, String pattern, int transform, org.apache.jackrabbit.core.query.lucene.PerQueryCache cache)
WildcardQuery
.field
- the name of the field to search.propName
- name of the property to search.pattern
- the wildcard pattern.transform
- how property values are transformed before they are
matched using the pattern
.public void setTransformation(int transformation)
setTransformation
in interface Transformable
transformation
- a transform constant.public org.apache.lucene.search.Query rewrite(org.apache.lucene.index.IndexReader reader) throws IOException
rewrite
in class org.apache.lucene.search.Query
reader
- the index reader to use for the search.IOException
- if an error occurs while reading from the index.public org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.Searcher searcher)
Weight
for this query.createWeight
in class org.apache.lucene.search.Query
searcher
- the searcher to use for the Weight
.Weigth
for this query.public String toString(String field)
toString
in class org.apache.lucene.search.Query
field
- the field name for which to create a string representation.public void extractTerms(Set<org.apache.lucene.index.Term> terms)
extractTerms
in class org.apache.lucene.search.Query
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.