當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。