當前位置: 首頁>>代碼示例>>Java>>正文


Java TermsEnum.EMPTY屬性代碼示例

本文整理匯總了Java中org.apache.lucene.index.TermsEnum.EMPTY屬性的典型用法代碼示例。如果您正苦於以下問題:Java TermsEnum.EMPTY屬性的具體用法?Java TermsEnum.EMPTY怎麽用?Java TermsEnum.EMPTY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.lucene.index.TermsEnum的用法示例。


在下文中一共展示了TermsEnum.EMPTY屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTermsEnum

/** Return a {@link TermsEnum} intersecting the provided {@link Terms}
 *  with the terms accepted by this automaton. */
public TermsEnum getTermsEnum(Terms terms) throws IOException {
  switch(type) {
  case NONE:
    return TermsEnum.EMPTY;
  case ALL:
    return terms.iterator(null);
  case SINGLE:
    return new SingleTermsEnum(terms.iterator(null), term);
  case PREFIX:
    // TODO: this is very likely faster than .intersect,
    // but we should test and maybe cutover
    return new PrefixTermsEnum(terms.iterator(null), term);
  case NORMAL:
    return terms.intersect(this, null);
  default:
    // unreachable
    throw new RuntimeException("unhandled case");
  }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:21,代碼來源:CompiledAutomaton.java

示例2: getTermsEnum

@Override @SuppressWarnings("unchecked")
protected TermsEnum getTermsEnum(final Terms terms, AttributeSource atts) throws IOException {
  // very strange: java.lang.Number itself is not Comparable, but all subclasses used here are
  if (min != null && max != null && ((Comparable<T>) min).compareTo(max) > 0) {
    return TermsEnum.EMPTY;
  }
  return new NumericRangeTermsEnum(terms.iterator(null));
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:8,代碼來源:NumericRangeQuery.java

示例3: getTermsEnum

@Override
protected TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException {
  if (lowerTerm != null && upperTerm != null && lowerTerm.compareTo(upperTerm) > 0) {
    return TermsEnum.EMPTY;
  }
  
  TermsEnum tenum = terms.iterator(null);
  
  if ((lowerTerm == null || (includeLower && lowerTerm.length == 0)) && upperTerm == null) {
    return tenum;
  }
  return new TermRangeTermsEnum(tenum,
      lowerTerm, upperTerm, includeLower, includeUpper);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:14,代碼來源:TermRangeQuery.java

示例4: iterator

@Override public TermsEnum iterator() throws IOException { return TermsEnum.EMPTY; } 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:1,代碼來源:TermVectorsWriter.java


注:本文中的org.apache.lucene.index.TermsEnum.EMPTY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。