Example usage for org.apache.lucene.codecs PointsFormat PointsFormat

List of usage examples for org.apache.lucene.codecs PointsFormat PointsFormat

Introduction

In this page you can find the example usage for org.apache.lucene.codecs PointsFormat PointsFormat.

Prototype

protected PointsFormat() 

Source Link

Document

Creates a new point format.

Usage

From source file:perf.IndexAndSearchOpenStreetMaps.java

License:Apache License

private static Codec getCodec(boolean fast) {
    if (fast) {/*from ww w  .j  av a 2  s  .c o  m*/
        return new FilterCodec("Lucene62", Codec.getDefault()) {
            @Override
            public PointsFormat pointsFormat() {
                return new PointsFormat() {
                    @Override
                    public PointsWriter fieldsWriter(SegmentWriteState writeState) throws IOException {
                        int maxPointsInLeafNode = 1024;
                        return new Lucene60PointsWriter(writeState, maxPointsInLeafNode,
                                BKDWriter.DEFAULT_MAX_MB_SORT_IN_HEAP);
                    }

                    @Override
                    public PointsReader fieldsReader(SegmentReadState readState) throws IOException {
                        return new Lucene60PointsReader(readState);
                    }
                };
            }
        };
    } else {
        return Codec.forName("Lucene62");
    }
}