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


Java BinaryDocValues.EMPTY属性代码示例

本文整理汇总了Java中org.apache.lucene.index.BinaryDocValues.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java BinaryDocValues.EMPTY属性的具体用法?Java BinaryDocValues.EMPTY怎么用?Java BinaryDocValues.EMPTY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.lucene.index.BinaryDocValues的用法示例。


在下文中一共展示了BinaryDocValues.EMPTY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTerms

public BinaryDocValues getTerms(AtomicReader reader, String field, float acceptableOverheadRatio) throws IOException {
  BinaryDocValues valuesIn = reader.getBinaryDocValues(field);
  if (valuesIn == null) {
    valuesIn = reader.getSortedDocValues(field);
  }

  if (valuesIn != null) {
    // Not cached here by FieldCacheImpl (cached instead
    // per-thread by SegmentReader):
    return valuesIn;
  }

  final FieldInfo info = reader.getFieldInfos().fieldInfo(field);
  if (info == null) {
    return BinaryDocValues.EMPTY;
  } else if (info.hasDocValues()) {
    throw new IllegalStateException("Type mismatch: " + field + " was indexed as " + info.getDocValuesType());
  } else if (!info.isIndexed()) {
    return BinaryDocValues.EMPTY;
  }

  return (BinaryDocValues) caches.get(BinaryDocValues.class).get(reader, new CacheKey(field, acceptableOverheadRatio), false);
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:23,代码来源:FieldCacheImpl.java

示例2: getTerms

public BinaryDocValues getTerms(AtomicReader reader, String field, boolean setDocsWithField, float acceptableOverheadRatio) throws IOException {
  BinaryDocValues valuesIn = reader.getBinaryDocValues(field);
  if (valuesIn == null) {
    valuesIn = reader.getSortedDocValues(field);
  }

  if (valuesIn != null) {
    // Not cached here by FieldCacheImpl (cached instead
    // per-thread by SegmentReader):
    return valuesIn;
  }

  final FieldInfo info = reader.getFieldInfos().fieldInfo(field);
  if (info == null) {
    return BinaryDocValues.EMPTY;
  } else if (info.hasDocValues()) {
    throw new IllegalStateException("Type mismatch: " + field + " was indexed as " + info.getDocValuesType());
  } else if (!info.isIndexed()) {
    return BinaryDocValues.EMPTY;
  }

  return (BinaryDocValues) caches.get(BinaryDocValues.class).get(reader, new CacheKey(field, acceptableOverheadRatio), setDocsWithField);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:FieldCacheImpl.java

示例3: getReader

@Override
public OrdinalsSegmentReader getReader(AtomicReaderContext context) throws IOException {
  BinaryDocValues values0 = context.reader().getBinaryDocValues(field);
  if (values0 == null) {
    values0 = BinaryDocValues.EMPTY;
  }

  final BinaryDocValues values = values0;

  return new OrdinalsSegmentReader() {
    private final BytesRef bytes = new BytesRef(32);

    @Override
    public void get(int docID, IntsRef ordinals) throws IOException {
      values.get(docID, bytes);
      decode(bytes, ordinals);
    }
  };
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:DocValuesOrdinalsReader.java


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