本文整理匯總了Java中org.apache.lucene.search.WildcardQuery.setRewriteMethod方法的典型用法代碼示例。如果您正苦於以下問題:Java WildcardQuery.setRewriteMethod方法的具體用法?Java WildcardQuery.setRewriteMethod怎麽用?Java WildcardQuery.setRewriteMethod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.lucene.search.WildcardQuery
的用法示例。
在下文中一共展示了WildcardQuery.setRewriteMethod方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: build
import org.apache.lucene.search.WildcardQuery; //導入方法依賴的package包/類
@Override
public WildcardQuery build(QueryNode queryNode) throws QueryNodeException {
WildcardQueryNode wildcardNode = (WildcardQueryNode) queryNode;
WildcardQuery q = new WildcardQuery(new Term(wildcardNode.getFieldAsString(),
wildcardNode.getTextAsString()));
MultiTermQuery.RewriteMethod method = (MultiTermQuery.RewriteMethod)queryNode.getTag(MultiTermRewriteMethodProcessor.TAG_ID);
if (method != null) {
q.setRewriteMethod(method);
}
return q;
}
示例2: getPrebuiltQueries
import org.apache.lucene.search.WildcardQuery; //導入方法依賴的package包/類
private static Query[] getPrebuiltQueries(String field) {
WildcardQuery wcq = new WildcardQuery(new Term(field, "fo*"));
wcq .setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE);
// be wary of unanalyzed text
return new Query[] {
new SpanFirstQuery(new SpanTermQuery(new Term(field, "ford")), 5),
new SpanNearQuery(new SpanQuery[] {
new SpanTermQuery(new Term(field, "night")),
new SpanTermQuery(new Term(field, "trading")) }, 4, false),
new SpanNearQuery(new SpanQuery[] {
new SpanFirstQuery(new SpanTermQuery(new Term(field, "ford")), 10),
new SpanTermQuery(new Term(field, "credit")) }, 10, false), wcq, };
}
示例3: newWildcardQuery
import org.apache.lucene.search.WildcardQuery; //導入方法依賴的package包/類
/**
* Builds a new WildcardQuery instance
* @param t wildcard term
* @return new WildcardQuery instance
*/
protected Query newWildcardQuery(Term t) {
WildcardQuery query = new WildcardQuery(t);
SchemaField sf = schema.getField(t.field());
query.setRewriteMethod(sf.getType().getRewriteMethod(parser, sf));
return query;
}
示例4: newWildcardQuery
import org.apache.lucene.search.WildcardQuery; //導入方法依賴的package包/類
/**
* Builds a new WildcardQuery instance
*
* @param t wildcard term
* @return new WildcardQuery instance
*/
protected Query newWildcardQuery(Term t) {
WildcardQuery query = new WildcardQuery(t);
query.setRewriteMethod(multiTermRewriteMethod);
return query;
}
示例5: newWildcardQuery
import org.apache.lucene.search.WildcardQuery; //導入方法依賴的package包/類
/**
* Builds a new WildcardQuery instance
*
* @param t
* wildcard term
* @return new WildcardQuery instance
*/
protected Query newWildcardQuery(Term t) {
WildcardQuery query = new WildcardQuery(t, maxDeterminizedStates);
query.setRewriteMethod(multiTermRewriteMethod);
return query;
}