Java 类org.apache.lucene.index.MultiDocValues.MultiSortedDocValues 实例源码

项目:lams    文件:SlowCompositeReaderWrapper.java   
@Override
public SortedDocValues getSortedDocValues(String field) throws IOException {
  ensureOpen();
  OrdinalMap map = null;
  synchronized (cachedOrdMaps) {
    map = cachedOrdMaps.get(field);
    if (map == null) {
      // uncached, or not a multi dv
      SortedDocValues dv = MultiDocValues.getSortedValues(in, field);
      if (dv instanceof MultiSortedDocValues) {
        map = ((MultiSortedDocValues)dv).mapping;
        if (map.owner == getCoreCacheKey()) {
          cachedOrdMaps.put(field, map);
        }
      }
      return dv;
    }
  }
  // cached ordinal map
  if (getFieldInfos().fieldInfo(field).getDocValuesType() != DocValuesType.SORTED) {
    return null;
  }
  int size = in.leaves().size();
  final SortedDocValues[] values = new SortedDocValues[size];
  final int[] starts = new int[size+1];
  for (int i = 0; i < size; i++) {
    AtomicReaderContext context = in.leaves().get(i);
    SortedDocValues v = context.reader().getSortedDocValues(field);
    if (v == null) {
      v = DocValues.emptySorted();
    }
    values[i] = v;
    starts[i] = context.docBase;
  }
  starts[size] = maxDoc();
  return new MultiSortedDocValues(values, starts, map);
}
项目:search    文件:SlowCompositeReaderWrapper.java   
@Override
public SortedDocValues getSortedDocValues(String field) throws IOException {
  ensureOpen();
  OrdinalMap map = null;
  synchronized (cachedOrdMaps) {
    map = cachedOrdMaps.get(field);
    if (map == null) {
      // uncached, or not a multi dv
      SortedDocValues dv = MultiDocValues.getSortedValues(in, field);
      if (dv instanceof MultiSortedDocValues) {
        map = ((MultiSortedDocValues)dv).mapping;
        if (map.owner == getCoreCacheKey()) {
          cachedOrdMaps.put(field, map);
        }
      }
      return dv;
    }
  }
  // cached ordinal map
  if (getFieldInfos().fieldInfo(field).getDocValuesType() != DocValuesType.SORTED) {
    return null;
  }
  int size = in.leaves().size();
  final SortedDocValues[] values = new SortedDocValues[size];
  final int[] starts = new int[size+1];
  for (int i = 0; i < size; i++) {
    AtomicReaderContext context = in.leaves().get(i);
    SortedDocValues v = context.reader().getSortedDocValues(field);
    if (v == null) {
      v = DocValues.emptySorted();
    }
    values[i] = v;
    starts[i] = context.docBase;
  }
  starts[size] = maxDoc();
  return new MultiSortedDocValues(values, starts, map);
}
项目:NYBC    文件:SlowCompositeReaderWrapper.java   
@Override
public SortedDocValues getSortedDocValues(String field) throws IOException {
  ensureOpen();
  OrdinalMap map = null;
  synchronized (cachedOrdMaps) {
    map = cachedOrdMaps.get(field);
    if (map == null) {
      // uncached, or not a multi dv
      SortedDocValues dv = MultiDocValues.getSortedValues(in, field);
      if (dv instanceof MultiSortedDocValues) {
        map = ((MultiSortedDocValues)dv).mapping;
        if (map.owner == getCoreCacheKey()) {
          cachedOrdMaps.put(field, map);
        }
      }
      return dv;
    }
  }
  // cached ordinal map
  if (getFieldInfos().fieldInfo(field).getDocValuesType() != DocValuesType.SORTED) {
    return null;
  }
  int size = in.leaves().size();
  final SortedDocValues[] values = new SortedDocValues[size];
  final int[] starts = new int[size+1];
  for (int i = 0; i < size; i++) {
    AtomicReaderContext context = in.leaves().get(i);
    SortedDocValues v = context.reader().getSortedDocValues(field);
    if (v == null) {
      v = SortedDocValues.EMPTY;
    }
    values[i] = v;
    starts[i] = context.docBase;
  }
  starts[size] = maxDoc();
  return new MultiSortedDocValues(values, starts, map);
}
项目:read-open-source-code    文件:SlowCompositeReaderWrapper.java   
@Override
public SortedDocValues getSortedDocValues(String field) throws IOException {
  ensureOpen();
  OrdinalMap map = null;
  synchronized (cachedOrdMaps) {
    map = cachedOrdMaps.get(field);
    if (map == null) {
      // uncached, or not a multi dv
      SortedDocValues dv = MultiDocValues.getSortedValues(in, field);
      if (dv instanceof MultiSortedDocValues) {
        map = ((MultiSortedDocValues)dv).mapping;
        if (map.owner == getCoreCacheKey()) {
          cachedOrdMaps.put(field, map);
        }
      }
      return dv;
    }
  }
  // cached ordinal map
  if (getFieldInfos().fieldInfo(field).getDocValuesType() != DocValuesType.SORTED) {
    return null;
  }
  int size = in.leaves().size();
  final SortedDocValues[] values = new SortedDocValues[size];
  final int[] starts = new int[size+1];
  for (int i = 0; i < size; i++) {
    AtomicReaderContext context = in.leaves().get(i);
    SortedDocValues v = context.reader().getSortedDocValues(field);
    if (v == null) {
      v = SortedDocValues.EMPTY;
    }
    values[i] = v;
    starts[i] = context.docBase;
  }
  starts[size] = maxDoc();
  return new MultiSortedDocValues(values, starts, map);
}
项目:read-open-source-code    文件:SlowCompositeReaderWrapper.java   
@Override
public SortedDocValues getSortedDocValues(String field) throws IOException {
  ensureOpen();
  OrdinalMap map = null;
  synchronized (cachedOrdMaps) {
    map = cachedOrdMaps.get(field);
    if (map == null) {
      // uncached, or not a multi dv
      SortedDocValues dv = MultiDocValues.getSortedValues(in, field);
      if (dv instanceof MultiSortedDocValues) {
        map = ((MultiSortedDocValues)dv).mapping;
        if (map.owner == getCoreCacheKey()) {
          cachedOrdMaps.put(field, map);
        }
      }
      return dv;
    }
  }
  // cached ordinal map
  if (getFieldInfos().fieldInfo(field).getDocValuesType() != DocValuesType.SORTED) {
    return null;
  }
  int size = in.leaves().size();
  final SortedDocValues[] values = new SortedDocValues[size];
  final int[] starts = new int[size+1];
  for (int i = 0; i < size; i++) {
    AtomicReaderContext context = in.leaves().get(i);
    SortedDocValues v = context.reader().getSortedDocValues(field);
    if (v == null) {
      v = SortedDocValues.EMPTY;
    }
    values[i] = v;
    starts[i] = context.docBase;
  }
  starts[size] = maxDoc();
  return new MultiSortedDocValues(values, starts, map);
}
项目:read-open-source-code    文件:SlowCompositeReaderWrapper.java   
@Override
public SortedDocValues getSortedDocValues(String field) throws IOException {
  ensureOpen();
  OrdinalMap map = null;
  synchronized (cachedOrdMaps) {
    map = cachedOrdMaps.get(field);
    if (map == null) {
      // uncached, or not a multi dv
      SortedDocValues dv = MultiDocValues.getSortedValues(in, field);
      if (dv instanceof MultiSortedDocValues) {
        map = ((MultiSortedDocValues)dv).mapping;
        if (map.owner == getCoreCacheKey()) {
          cachedOrdMaps.put(field, map);
        }
      }
      return dv;
    }
  }
  // cached ordinal map
  if (getFieldInfos().fieldInfo(field).getDocValuesType() != DocValuesType.SORTED) {
    return null;
  }
  int size = in.leaves().size();
  final SortedDocValues[] values = new SortedDocValues[size];
  final int[] starts = new int[size+1];
  for (int i = 0; i < size; i++) {
    AtomicReaderContext context = in.leaves().get(i);
    SortedDocValues v = context.reader().getSortedDocValues(field);
    if (v == null) {
      v = DocValues.emptySorted();
    }
    values[i] = v;
    starts[i] = context.docBase;
  }
  starts[size] = maxDoc();
  return new MultiSortedDocValues(values, starts, map);
}
项目:Maskana-Gestor-de-Conocimiento    文件:SlowCompositeReaderWrapper.java   
@Override
public SortedDocValues getSortedDocValues(String field) throws IOException {
  ensureOpen();
  OrdinalMap map = null;
  synchronized (cachedOrdMaps) {
    map = cachedOrdMaps.get(field);
    if (map == null) {
      // uncached, or not a multi dv
      SortedDocValues dv = MultiDocValues.getSortedValues(in, field);
      if (dv instanceof MultiSortedDocValues) {
        map = ((MultiSortedDocValues)dv).mapping;
        if (map.owner == getCoreCacheKey()) {
          cachedOrdMaps.put(field, map);
        }
      }
      return dv;
    }
  }
  // cached ordinal map
  if (getFieldInfos().fieldInfo(field).getDocValuesType() != DocValuesType.SORTED) {
    return null;
  }
  int size = in.leaves().size();
  final SortedDocValues[] values = new SortedDocValues[size];
  final int[] starts = new int[size+1];
  for (int i = 0; i < size; i++) {
    AtomicReaderContext context = in.leaves().get(i);
    SortedDocValues v = context.reader().getSortedDocValues(field);
    if (v == null) {
      v = SortedDocValues.EMPTY;
    }
    values[i] = v;
    starts[i] = context.docBase;
  }
  starts[size] = maxDoc();
  return new MultiSortedDocValues(values, starts, map);
}