Tabnine Logo
IndexableField.binaryValue
Code IndexAdd Tabnine to your IDE (free)

How to use
binaryValue
method
in
org.apache.lucene.index.IndexableField

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

origin: org.apache.lucene/lucene-core

/**
* Returns an array of bytes for the first (or only) field that has the name
* specified as the method parameter. This method will return <code>null</code>
* if no binary fields with the specified name are available.
* There may be non-binary fields with the same name.
*
* @param name the name of the field.
* @return a <code>BytesRef</code> containing the binary field value or <code>null</code>
*/
public final BytesRef getBinaryValue(String name) {
 for (IndexableField field : fields) {
  if (field.name().equals(name)) {
   final BytesRef bytes = field.binaryValue();
   if (bytes != null) {
    return bytes;
   }
  }
 }
 return null;
}
origin: org.apache.lucene/lucene-core

/**
* Returns an array of byte arrays for of the fields that have the name specified
* as the method parameter.  This method returns an empty
* array when there are no matching fields.  It never
* returns null.
*
* @param name the name of the field
* @return a <code>BytesRef[]</code> of binary field values
*/
public final BytesRef[] getBinaryValues(String name) {
 final List<BytesRef> result = new ArrayList<>();
 for (IndexableField field : fields) {
  if (field.name().equals(name)) {
   final BytesRef bytes = field.binaryValue();
   if (bytes != null) {
    result.add(bytes);
   }
  }
 }

 return result.toArray(new BytesRef[result.size()]);
}

origin: apache/geode

/**
 * Extract the Apache Geode key term from a lucene document
 */
public static Term getKeyTerm(Document doc) {
 IndexableField field = doc.getField(KEY_FIELD);
 if (field.stringValue() != null) {
  return new Term(KEY_FIELD, field.stringValue());
 } else {
  return new Term(KEY_FIELD, field.binaryValue());
 }
}
origin: apache/geode

/**
 * Extract the Apache Geode key from a lucene document
 */
public static Object getKey(Document doc) {
 IndexableField field = doc.getField(KEY_FIELD);
 if (field.stringValue() != null) {
  return field.stringValue();
 } else {
  return keyFromBytes(field.binaryValue());
 }
}
origin: oracle/opengrok

      objser.binaryValue().bytes);
} catch (ClassNotFoundException ex) {
origin: oracle/opengrok

IndexableField tags = doc.getField(QueryBuilder.TAGS);
if (tags != null) {
  return Definitions.deserialize(tags.binaryValue().bytes);
origin: oracle/opengrok

IndexableField tagsField = doc.getField(QueryBuilder.TAGS);
if (tagsField != null) {
  tags = Definitions.deserialize(tagsField.binaryValue().bytes);
  scopes = Scopes.deserialize(scopesField.binaryValue().bytes);
} else {
  scopes = new Scopes();
origin: oracle/opengrok

IndexableField tagsField = doc.getField(QueryBuilder.TAGS);
if (tagsField != null) {
  tags = Definitions.deserialize(tagsField.binaryValue().bytes);
  scopes = Scopes.deserialize(scopesField.binaryValue().bytes);
origin: org.apache.lucene/lucene-core

 bytes = null;
} else {
 bytes = field.binaryValue();
 if (bytes != null) {
  bits = BYTE_ARR;
origin: oracle/opengrok

Document doc = searcher.doc(hits[0].doc);
if (doc.getField(QueryBuilder.TAGS) != null) {
  byte[] rawTags = doc.getField(QueryBuilder.TAGS).binaryValue().bytes;
  Definitions tags = Definitions.deserialize(rawTags);
  String symbol = ((TermQuery) query).getTerm().text();
origin: org.apache.lucene/lucene-core

 fp.docValuesWriter = new BinaryDocValuesWriter(fp.fieldInfo, bytesUsed);
((BinaryDocValuesWriter) fp.docValuesWriter).addValue(docID, field.binaryValue());
break;
 fp.docValuesWriter = new SortedDocValuesWriter(fp.fieldInfo, bytesUsed);
((SortedDocValuesWriter) fp.docValuesWriter).addValue(docID, field.binaryValue());
break;
 fp.docValuesWriter = new SortedSetDocValuesWriter(fp.fieldInfo, bytesUsed);
((SortedSetDocValuesWriter) fp.docValuesWriter).addValue(docID, field.binaryValue());
break;
origin: oracle/opengrok

IndexableField tagsField = doc.getField(QueryBuilder.TAGS);
if (tagsField != null) {
  tags = Definitions.deserialize(tagsField.binaryValue().bytes);
IndexableField scopesField = doc.getField(QueryBuilder.SCOPES);
if (scopesField != null) {
  scopes = Scopes.deserialize(scopesField.binaryValue().bytes);
} else {
  scopes = new Scopes();
origin: org.apache.lucene/lucene-core

/** Called from processDocument to index one field's point */
private void indexPoint(PerField fp, IndexableField field) throws IOException {
 int pointDataDimensionCount = field.fieldType().pointDataDimensionCount();
 int pointIndexDimensionCount = field.fieldType().pointIndexDimensionCount();
 int dimensionNumBytes = field.fieldType().pointNumBytes();
 // Record dimensions for this field; this setter will throw IllegalArgExc if
 // the dimensions were already set to something different:
 if (fp.fieldInfo.getPointDataDimensionCount() == 0) {
  fieldInfos.globalFieldNumbers.setDimensions(fp.fieldInfo.number, fp.fieldInfo.name, pointDataDimensionCount, pointIndexDimensionCount, dimensionNumBytes);
 }
 fp.fieldInfo.setPointDimensions(pointDataDimensionCount, pointIndexDimensionCount, dimensionNumBytes);
 if (fp.pointValuesWriter == null) {
  fp.pointValuesWriter = new PointValuesWriter(docWriter, fp.fieldInfo);
 }
 fp.pointValuesWriter.addPackedValue(docState.docID, field.binaryValue());
}
origin: oracle/opengrok

analyzer.analyze(doc, getStreamSource(path), xrefOut);
Definitions definitions = Definitions.deserialize(doc.getField(QueryBuilder.TAGS).binaryValue().bytes);
origin: org.elasticsearch/elasticsearch

public BytesRef getBinaryValue(String name) {
  for (IndexableField f : fields) {
    if (f.name().equals(name) && f.binaryValue() != null) {
      return f.binaryValue();
    }
  }
  return null;
}
origin: oracle/opengrok

analyzer.analyze(doc, getStreamSource(path), xrefOut);
Definitions definitions = Definitions.deserialize(doc.getField(QueryBuilder.TAGS).binaryValue().bytes);
assertNotNull(definitions);
String[] type = new String[1];
origin: oracle/opengrok

Scopes scopes = Scopes.deserialize(scopesField.binaryValue().bytes);
Scope globalScope = scopes.getScope(-1);
assertEquals(3, scopes.size()); // foo, bar, main
origin: oracle/opengrok

Scopes scopes = Scopes.deserialize(scopesField.binaryValue().bytes);
Scope globalScope = scopes.getScope(-1);
assertEquals(4, scopes.size()); //TODO 5
origin: oracle/opengrok

Scopes scopes = Scopes.deserialize(scopesField.binaryValue().bytes);
Scope globalScope = scopes.getScope(-1);
assertEquals(5, scopes.size()); // foo, bar, main
origin: oracle/opengrok

Scopes scopes = Scopes.deserialize(scopesField.binaryValue().bytes);
Scope globalScope = scopes.getScope(-1);
assertEquals(9, scopes.size());
org.apache.lucene.indexIndexableFieldbinaryValue

Javadoc

Non-null if this field has a binary value

Popular methods of IndexableField

  • stringValue
    Non-null if this field has a string value
  • name
    Field name
  • numericValue
    Non-null if this field has a numeric value
  • fieldType
    IndexableFieldType describing the properties of this field.
  • tokenStream
    Creates the TokenStream used for indexing this field. If appropriate, implementations should use the
  • readerValue
    Non-null if this field has a Reader value
  • boost
    Returns the field's index-time boost. Only fields can have an index-time boost, if you want to simul

Popular in Java

  • Making http post requests using okhttp
  • findViewById (Activity)
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Notification (javax.management)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
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