本文整理汇总了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;
}