Package org.apache.lucene.index
Class Fields
- java.lang.Object
-
- org.apache.lucene.index.Fields
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.String>
- Direct Known Subclasses:
CompressingTermVectorsReader.TVFields,FieldsProducer,FilterLeafReader.FilterFields,FreqProxFields,MemoryIndex.MemoryIndexReader.MemoryFields,MultiFields,ParallelLeafReader.ParallelFields,SimpleTextTermVectorsReader.SimpleTVFields
public abstract class Fields extends java.lang.Object implements java.lang.Iterable<java.lang.String>Provides aTermsindex for fields that have it, and lists which fields do. This is primarily an internal/experimental API (seeFieldsProducer), although it is also used to expose the set of term vectors per document.
-
-
Field Summary
Fields Modifier and Type Field Description static Fields[]EMPTY_ARRAYZero-lengthFieldsarray.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFields()Sole constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.util.Iterator<java.lang.String>iterator()Returns an iterator that will step through all fields names.abstract intsize()Returns the number of fields or -1 if the number of distinct field names is unknown.abstract Termsterms(java.lang.String field)Get theTermsfor this field.
-
-
-
Field Detail
-
EMPTY_ARRAY
public static final Fields[] EMPTY_ARRAY
Zero-lengthFieldsarray.
-
-
Method Detail
-
iterator
public abstract java.util.Iterator<java.lang.String> iterator()
Returns an iterator that will step through all fields names. This will not return null.- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.String>
-
terms
public abstract Terms terms(java.lang.String field) throws java.io.IOException
Get theTermsfor this field. This will return null if the field does not exist.- Throws:
java.io.IOException
-
size
public abstract int size()
Returns the number of fields or -1 if the number of distinct field names is unknown. If >= 0,iterator()will return as many field names.
-
-