当前位置: 首页>>代码示例>>Java>>正文


Java WildcardQuery.setRewriteMethod方法代码示例

本文整理汇总了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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:WildcardQueryNodeBuilder.java

示例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, };
}
 
开发者ID:europeana,项目名称:search,代码行数:14,代码来源:EnwikiQueryMaker.java

示例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;
}
 
开发者ID:europeana,项目名称:search,代码行数:12,代码来源:SolrQueryParserBase.java

示例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;
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:12,代码来源:QueryParser.java

示例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;
}
 
开发者ID:easynet-cn,项目名称:resource-query-parser,代码行数:13,代码来源:QueryParserBase.java


注:本文中的org.apache.lucene.search.WildcardQuery.setRewriteMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。