Tabnine Logo
MultiFields.getMergedFieldInfos
Code IndexAdd Tabnine to your IDE (free)

How to use
getMergedFieldInfos
method
in
org.apache.lucene.index.MultiFields

Best Java code snippets using org.apache.lucene.index.MultiFields.getMergedFieldInfos (Showing top 20 results out of 315)

origin: org.apache.lucene/lucene-core

/** Call this to get the (merged) FieldInfos representing the
 *  set of indexed fields <b>only</b> for a composite reader. 
 *  <p>
 *  NOTE: the returned field numbers will likely not
 *  correspond to the actual field numbers in the underlying
 *  readers, and codec metadata ({@link FieldInfo#getAttribute(String)}
 *  will be unavailable.
 */
public static Collection<String> getIndexedFields(IndexReader reader) {
 final Collection<String> fields = new HashSet<>();
 for(final FieldInfo fieldInfo : getMergedFieldInfos(reader)) {
  if (fieldInfo.getIndexOptions() != IndexOptions.NONE) {
   fields.add(fieldInfo.name);
  }
 }
 return fields;
}
origin: org.apache.lucene/lucene-core

 return leaves.get(0).reader().getNormValues(field);
FieldInfo fi = MultiFields.getMergedFieldInfos(r).fieldInfo(field);
if (fi == null || fi.hasNorms() == false) {
 return null;
origin: apache/tika

@Override
public FieldInfos getFieldInfos() {
  ensureOpen();
  return MultiFields.getMergedFieldInfos(in);
}
origin: com.strapdata.elasticsearch.test/framework

public void assertFieldInfosEquals(String info, IndexReader leftReader, IndexReader rightReader) throws IOException {
 FieldInfos leftInfos = MultiFields.getMergedFieldInfos(leftReader);
 FieldInfos rightInfos = MultiFields.getMergedFieldInfos(rightReader);
 
 // TODO: would be great to verify more than just the names of the fields!
 TreeSet<String> left = new TreeSet<>();
 TreeSet<String> right = new TreeSet<>();
 
 for (FieldInfo fi : leftInfos) {
  left.add(fi.name);
 }
 
 for (FieldInfo fi : rightInfos) {
  right.add(fi.name);
 }
 
 assertEquals(info, left, right);
}
origin: org.infinispan/infinispan-embedded-query

@Override
public FieldInfos getFieldInfos() {
 ensureOpen();
 return MultiFields.getMergedFieldInfos(in);
}
origin: com.strapdata.elasticsearch.test/framework

private static Set<String> getDVFields(IndexReader reader) {
 Set<String> fields = new HashSet<>();
 for(FieldInfo fi : MultiFields.getMergedFieldInfos(reader)) {
  if (fi.getDocValuesType() != DocValuesType.NONE) {
   fields.add(fi.name);
  }
 }
 return fields;
}

origin: harbby/presto-connectors

@Override
public FieldInfos getFieldInfos() {
 ensureOpen();
 return MultiFields.getMergedFieldInfos(in);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/** Call this to get the (merged) FieldInfos representing the
 *  set of indexed fields <b>only</b> for a composite reader. 
 *  <p>
 *  NOTE: the returned field numbers will likely not
 *  correspond to the actual field numbers in the underlying
 *  readers, and codec metadata ({@link FieldInfo#getAttribute(String)}
 *  will be unavailable.
 */
public static Collection<String> getIndexedFields(IndexReader reader) {
 final Collection<String> fields = new HashSet<>();
 for(final FieldInfo fieldInfo : getMergedFieldInfos(reader)) {
  if (fieldInfo.getIndexOptions() != IndexOptions.NONE) {
   fields.add(fieldInfo.name);
  }
 }
 return fields;
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public FieldStats stats(IndexReader reader) throws IOException {
  int maxDoc = reader.maxDoc();
  FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
  if (fi == null) {
    return null;
  }
  /**
   * we don't have a specific type for geo_shape so we use an empty {@link FieldStats.Text}.
   * TODO: we should maybe support a new type that knows how to (de)encode the min/max information
   */
  return new FieldStats.Text(maxDoc, -1, -1, -1, isSearchable(), isAggregatable());
}

origin: com.strapdata.elasticsearch/elasticsearch

  @Override
  public FieldStats stats(IndexReader reader) throws IOException {
    int maxDoc = reader.maxDoc();
    FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
    if (fi == null) {
      return null;
    }
    /**
     * we don't have a specific type for geo_point so we use an empty {@link FieldStats.Text}.
     * TODO: we should maybe support a new type that knows how to (de)encode the min/max information
     */
    return new FieldStats.Text(maxDoc, -1, -1, -1, isSearchable(), isAggregatable());
  }
}
origin: org.codelibs/elasticsearch-querybuilders

  @Override
  public FieldStats stats(IndexReader reader) throws IOException {
    int maxDoc = reader.maxDoc();
    FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
    if (fi == null) {
      return null;
    }
    /**
     * we don't have a specific type for geo_shape so we use an empty {FieldStats.Text}.
     * TODO: we should maybe support a new type that knows how to (de)encode the min/max information
     */
    return new FieldStats.Text(maxDoc, -1, -1, -1, isSearchable(), isAggregatable());
  }
}
origin: org.codelibs/elasticsearch-querybuilders

  @Override
  public FieldStats stats(IndexReader reader) throws IOException {
    int maxDoc = reader.maxDoc();
    FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
    if (fi == null) {
      return null;
    }
    /**
     * we don't have a specific type for geo_point so we use an empty {FieldStats.Text}.
     * TODO: we should maybe support a new type that knows how to (de)encode the min/max information
     */
    return new FieldStats.Text(maxDoc, -1, -1, -1, isSearchable(), isAggregatable());
  }
}
origin: com.strapdata.elasticsearch/elasticsearch

  @Override
  public FieldStats.GeoPoint stats(IndexReader reader) throws IOException {
    String field = name();
    FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(field);
    if (fi == null) {
      return null;
    }
    Terms terms = org.apache.lucene.index.MultiFields.getTerms(reader, field);
    if (terms == null) {
      return new FieldStats.GeoPoint(reader.maxDoc(), 0L, -1L, -1L, isSearchable(), isAggregatable());
    }
    return new FieldStats.GeoPoint(reader.maxDoc(), terms.getDocCount(), -1L, terms.getSumTotalTermFreq(), isSearchable(),
      isAggregatable(), prefixCodedToGeoPoint(terms.getMin(), numericEncoded),
      prefixCodedToGeoPoint(terms.getMax(), numericEncoded));
  }
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public FieldStats.Long stats(IndexReader reader) throws IOException {
  int maxDoc = reader.maxDoc();
  FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
  if (fi == null) {
    return null;
  }
  Terms terms = org.apache.lucene.index.MultiFields.getTerms(reader, name());
  if (terms == null) {
    return new FieldStats.Long(maxDoc, 0, -1, -1, isSearchable(), isAggregatable());
  }
  long minValue = LegacyNumericUtils.getMinInt(terms);
  long maxValue = LegacyNumericUtils.getMaxInt(terms);
  return new FieldStats.Long(maxDoc, terms.getDocCount(),
    terms.getSumDocFreq(), terms.getSumTotalTermFreq(), isSearchable(), isAggregatable(),
    minValue, maxValue);
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public FieldStats stats(IndexReader reader) throws IOException {
  int maxDoc = reader.maxDoc();
  FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
  if (fi == null) {
    return null;
  }
  Terms terms = org.apache.lucene.index.MultiFields.getTerms(reader, name());
  if (terms == null) {
    return new FieldStats.Long(maxDoc, 0, -1, -1, isSearchable(), isAggregatable());
  }
  long minValue = LegacyNumericUtils.getMinLong(terms);
  long maxValue = LegacyNumericUtils.getMaxLong(terms);
  return new FieldStats.Long(
    maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(),
    isSearchable(), isAggregatable(), minValue, maxValue);
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public FieldStats.Long stats(IndexReader reader) throws IOException {
  int maxDoc = reader.maxDoc();
  FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
  if (fi == null) {
    return null;
  }
  Terms terms = org.apache.lucene.index.MultiFields.getTerms(reader, name());
  if (terms == null) {
    return new FieldStats.Long(maxDoc, 0, -1, -1, isSearchable(), isAggregatable());
  }
  long minValue = LegacyNumericUtils.getMinInt(terms);
  long maxValue = LegacyNumericUtils.getMaxInt(terms);
  return new FieldStats.Long(
    maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(),
    isSearchable(), isAggregatable(), minValue, maxValue);
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public FieldStats.Long stats(IndexReader reader) throws IOException {
  int maxDoc = reader.maxDoc();
  FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
  if (fi == null) {
    return null;
  }
  Terms terms = org.apache.lucene.index.MultiFields.getTerms(reader, name());
  if (terms == null) {
    return new FieldStats.Long(maxDoc, 0, -1, -1, isSearchable(), isAggregatable());
  }
  long minValue = LegacyNumericUtils.getMinInt(terms);
  long maxValue = LegacyNumericUtils.getMaxInt(terms);
  return new FieldStats.Long(
    maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(),
    isSearchable(), isAggregatable(), minValue, maxValue);
}
origin: org.codelibs/elasticsearch-querybuilders

@Override
public FieldStats.Date stats(IndexReader reader) throws IOException {
  int maxDoc = reader.maxDoc();
  FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
  if (fi == null) {
    return null;
  }
  Terms terms = org.apache.lucene.index.MultiFields.getTerms(reader, name());
  if (terms == null) {
    return new FieldStats.Date(maxDoc, 0, -1, -1, isSearchable(), isAggregatable());
  }
  long minValue = LegacyNumericUtils.getMinLong(terms);
  long maxValue = LegacyNumericUtils.getMaxLong(terms);
  return new FieldStats.Date(maxDoc, terms.getDocCount(),
    terms.getSumDocFreq(), terms.getSumTotalTermFreq(), isSearchable(), isAggregatable(),
    dateTimeFormatter(), minValue, maxValue);
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public FieldStats.Double stats(IndexReader reader) throws IOException {
  int maxDoc = reader.maxDoc();
  FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
  if (fi == null) {
    return null;
  }
  Terms terms = org.apache.lucene.index.MultiFields.getTerms(reader, name());
  if (terms == null) {
    return new FieldStats.Double(maxDoc, 0, -1, -1, isSearchable(), isAggregatable());
  }
  float minValue = NumericUtils.sortableIntToFloat(LegacyNumericUtils.getMinInt(terms));
  float maxValue = NumericUtils.sortableIntToFloat(LegacyNumericUtils.getMaxInt(terms));
  return new FieldStats.Double(maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(),
    isSearchable(), isAggregatable(), minValue, maxValue);
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public FieldStats.Double stats(IndexReader reader) throws IOException {
  int maxDoc = reader.maxDoc();
  FieldInfo fi = org.apache.lucene.index.MultiFields.getMergedFieldInfos(reader).fieldInfo(name());
  if (fi == null) {
    return null;
  }
  Terms terms = org.apache.lucene.index.MultiFields.getTerms(reader, name());
  if (terms == null) {
    return new FieldStats.Double(maxDoc, 0, -1, -1, isSearchable(), isAggregatable());
  }
  double minValue = NumericUtils.sortableLongToDouble(LegacyNumericUtils.getMinLong(terms));
  double maxValue = NumericUtils.sortableLongToDouble(LegacyNumericUtils.getMaxLong(terms));
  return new FieldStats.Double(maxDoc, terms.getDocCount(),
    terms.getSumDocFreq(), terms.getSumTotalTermFreq(), isSearchable(), isAggregatable(),
    minValue, maxValue);
}
org.apache.lucene.indexMultiFieldsgetMergedFieldInfos

Javadoc

Call this to get the (merged) FieldInfos for a composite reader.

NOTE: the returned field numbers will likely not correspond to the actual field numbers in the underlying readers, and codec metadata ( FieldInfo#getAttribute(String)will be unavailable.

Popular methods of MultiFields

  • getTerms
    This method may return null if the field does not exist or if it has no terms.
  • getFields
    Returns a single Fields instance for this reader, merging fields/terms/docs/positions on the fly. Th
  • getLiveDocs
    Returns a single Bits instance for this reader, merging live Documents on the fly. This method will
  • getIndexedFields
    Call this to get the (merged) FieldInfos representing the set of indexed fields only for a composit
  • getTermDocsEnum
    Returns PostingsEnum for the specified field and term, with control over whether freqs are required.
  • getTermPositionsEnum
    Returns PostingsEnum for the specified field and term, with control over whether offsets and payload
  • <init>
    Expert: construct a new MultiFields instance directly.

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • JTable (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Join (org.hibernate.mapping)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now