org.apache.lucene.facet.taxonomy
Class IntAssociationFacetField

java.lang.Object
  extended by org.apache.lucene.document.Field
      extended by org.apache.lucene.facet.taxonomy.AssociationFacetField
          extended by org.apache.lucene.facet.taxonomy.IntAssociationFacetField
All Implemented Interfaces:
IndexableField

public class IntAssociationFacetField
extends AssociationFacetField

Add an instance of this to your Document to add a facet label associated with an int. Use TaxonomyFacetSumIntAssociations to aggregate int values per facet label at search time.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.document.Field
Field.Index, Field.Store, Field.TermVector
 
Field Summary
 
Fields inherited from class org.apache.lucene.facet.taxonomy.AssociationFacetField
assoc, dim, path, TYPE
 
Fields inherited from class org.apache.lucene.document.Field
boost, fieldsData, name, tokenStream, type
 
Constructor Summary
IntAssociationFacetField(int assoc, String dim, String... path)
          Creates this from dim and path and an int association
 
Method Summary
static int bytesRefToInt(BytesRef b)
          Decodes a previously encoded int.
static BytesRef intToBytesRef(int v)
          Encodes an int as a 4-byte BytesRef, big-endian.
 String toString()
           
 
Methods inherited from class org.apache.lucene.document.Field
binaryValue, boost, fieldType, name, numericValue, readerValue, setBoost, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, translateFieldType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntAssociationFacetField

public IntAssociationFacetField(int assoc,
                                String dim,
                                String... path)
Creates this from dim and path and an int association

Method Detail

intToBytesRef

public static BytesRef intToBytesRef(int v)
Encodes an int as a 4-byte BytesRef, big-endian.


bytesRefToInt

public static int bytesRefToInt(BytesRef b)
Decodes a previously encoded int.


toString

public String toString()
Overrides:
toString in class AssociationFacetField


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.