org.apache.lucene.codecs.simpletext
Class SimpleTextNormsFormat.SimpleTextNormsPerDocConsumer

java.lang.Object
  extended by org.apache.lucene.codecs.PerDocConsumer
      extended by org.apache.lucene.codecs.simpletext.SimpleTextNormsFormat.SimpleTextNormsPerDocConsumer
All Implemented Interfaces:
Closeable
Enclosing class:
SimpleTextNormsFormat

public static class SimpleTextNormsFormat.SimpleTextNormsPerDocConsumer
extends PerDocConsumer

Writes plain-text norms.

FOR RECREATIONAL USE ONLY

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

Field Summary
protected  String segmentSuffix
           
protected  PerDocWriteState state
           
 
Constructor Summary
SimpleTextNormsFormat.SimpleTextNormsPerDocConsumer(PerDocWriteState state)
           
 
Method Summary
 void abort()
          Called during indexing if the indexing session is aborted due to a unrecoverable exception.
 DocValuesConsumer addValuesField(DocValues.Type type, FieldInfo field)
          Adds a new DocValuesField
protected  boolean canMerge(FieldInfo info)
          Returns true iff the given field can be merged ie.
 void close()
           
protected  DocValues getDocValuesForMerge(AtomicReader reader, FieldInfo info)
          Returns a DocValues instance for merging from the given reader for the given FieldInfo.
protected  DocValues.Type getDocValuesType(FieldInfo info)
          Returns the DocValues DocValues.Type for the given FieldInfo.
 
Methods inherited from class org.apache.lucene.codecs.PerDocConsumer
merge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

protected final PerDocWriteState state

segmentSuffix

protected final String segmentSuffix
Constructor Detail

SimpleTextNormsFormat.SimpleTextNormsPerDocConsumer

public SimpleTextNormsFormat.SimpleTextNormsPerDocConsumer(PerDocWriteState state)
Method Detail

getDocValuesForMerge

protected DocValues getDocValuesForMerge(AtomicReader reader,
                                         FieldInfo info)
                                  throws IOException
Description copied from class: PerDocConsumer
Returns a DocValues instance for merging from the given reader for the given FieldInfo. This method is used for merging and uses AtomicReader.docValues(String) by default.

To enable DocValues merging for different DocValues than the default override this method accordingly.

Overrides:
getDocValuesForMerge in class PerDocConsumer
Throws:
IOException

canMerge

protected boolean canMerge(FieldInfo info)
Description copied from class: PerDocConsumer
Returns true iff the given field can be merged ie. has DocValues. By default this method uses FieldInfo.hasDocValues().

To enable DocValues merging for different DocValues than the default override this method accordingly.

Overrides:
canMerge in class PerDocConsumer

getDocValuesType

protected DocValues.Type getDocValuesType(FieldInfo info)
Description copied from class: PerDocConsumer
Returns the DocValues DocValues.Type for the given FieldInfo. By default this method uses FieldInfo.getDocValuesType().

To enable DocValues merging for different DocValues than the default override this method accordingly.

Overrides:
getDocValuesType in class PerDocConsumer

abort

public void abort()
Description copied from class: PerDocConsumer
Called during indexing if the indexing session is aborted due to a unrecoverable exception. This method should cleanup all resources.


close

public void close()
           throws IOException
Throws:
IOException

addValuesField

public DocValuesConsumer addValuesField(DocValues.Type type,
                                        FieldInfo field)
                                 throws IOException
Description copied from class: PerDocConsumer
Adds a new DocValuesField

Specified by:
addValuesField in class PerDocConsumer
Throws:
IOException


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