github.com/balzaczyy/golucene@v0.0.0-20151210033525-d0be9ee89713/core/codec/lucene49/codec.go (about)

     1  package lucene49
     2  
     3  import (
     4  	"github.com/balzaczyy/golucene/core/codec/lucene40"
     5  	"github.com/balzaczyy/golucene/core/codec/lucene41"
     6  	"github.com/balzaczyy/golucene/core/codec/lucene42"
     7  	"github.com/balzaczyy/golucene/core/codec/lucene46"
     8  	"github.com/balzaczyy/golucene/core/codec/perfield"
     9  	. "github.com/balzaczyy/golucene/core/codec/spi"
    10  )
    11  
    12  // lucene49/lucene49Codec.java
    13  
    14  func init() {
    15  	RegisterCodec(newLucene49Codec())
    16  }
    17  
    18  /*
    19  Implements the Lucene 4.9 index format, with configurable per-field
    20  postings and docvalues formats.
    21  
    22  If you want to reuse functionality of this codec in another codec,
    23  extend FilterCodec.
    24  */
    25  type Lucene49Codec struct {
    26  	*CodecImpl
    27  }
    28  
    29  func newLucene49Codec() *Lucene49Codec {
    30  	return &Lucene49Codec{NewCodec("Lucene49",
    31  		lucene41.NewLucene41StoredFieldsFormat(),
    32  		lucene42.NewLucene42TermVectorsFormat(),
    33  		lucene46.NewLucene46FieldInfosFormat(),
    34  		lucene46.NewLucene46SegmentInfoFormat(),
    35  		new(lucene40.Lucene40LiveDocsFormat),
    36  		perfield.NewPerFieldPostingsFormat(func(field string) PostingsFormat {
    37  			return LoadPostingsFormat("Lucene41")
    38  		}),
    39  		perfield.NewPerFieldDocValuesFormat(func(field string) DocValuesFormat {
    40  			panic("not implemented yet")
    41  		}),
    42  		new(Lucene49NormsFormat),
    43  	)}
    44  }