Examples of Lucene42Codec


Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

        dvFormat = DocValuesFormat.forName(formats[random.nextInt(formats.length)]);
      } else {
        dvFormat = DocValuesFormat.forName(TEST_DOCVALUESFORMAT);
      }
     
      codec = new Lucene42Codec() {      
        @Override
        public PostingsFormat getPostingsFormatForField(String field) {
          return format;
        }
View Full Code Here

Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

    Directory directory = newDirectory();
    // we don't use RandomIndexWriter because it might add more docvalues than we expect !!!!1
    IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer);
    final DocValuesFormat fast = DocValuesFormat.forName("Lucene42");
    final DocValuesFormat slow = DocValuesFormat.forName("SimpleText");
    iwc.setCodec(new Lucene42Codec() {
      @Override
      public DocValuesFormat getDocValuesFormatForField(String field) {
        if ("dv1".equals(field)) {
          return fast;
        } else {
View Full Code Here

Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

        dvFormat = DocValuesFormat.forName(formats[random.nextInt(formats.length)]);
      } else {
        dvFormat = DocValuesFormat.forName(TEST_DOCVALUESFORMAT);
      }
     
      codec = new Lucene42Codec() {      
        @Override
        public PostingsFormat getPostingsFormatForField(String field) {
          return format;
        }
View Full Code Here

Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

    // (and maybe their params, too) to infostream on flush and merge.
    // otherwise in a real debugging situation we won't know whats going on!
    if (LuceneTestCase.VERBOSE) {
      System.out.println("forcing postings format to:" + format);
    }
    return new Lucene42Codec() {
      @Override
      public PostingsFormat getPostingsFormatForField(String field) {
        return format;
      }
    };
View Full Code Here

Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

    // (and maybe their params, too) to infostream on flush and merge.
    // otherwise in a real debugging situation we won't know whats going on!
    if (LuceneTestCase.VERBOSE) {
      System.out.println("forcing docvalues format to:" + format);
    }
    return new Lucene42Codec() {
      @Override
      public DocValuesFormat getDocValuesFormatForField(String field) {
        return format;
      }
    };
View Full Code Here

Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

 
  public void testWriteReadMerge() throws IOException {
    // get another codec, other than the default: so we are merging segments across different codecs
    final Codec otherCodec;
    if ("SimpleText".equals(Codec.getDefault().getName())) {
      otherCodec = new Lucene42Codec();
    } else {
      otherCodec = new SimpleTextCodec();
    }
    Directory dir = newDirectory();
    IndexWriterConfig iwConf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
View Full Code Here

Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

  /** Override this to customize index settings, e.g. which
   *  codec to use. */
  protected IndexWriterConfig getIndexWriterConfig(Version matchVersion, Analyzer indexAnalyzer) {
    IndexWriterConfig iwc = new IndexWriterConfig(matchVersion, indexAnalyzer);
    iwc.setCodec(new Lucene42Codec());
    iwc.setOpenMode(IndexWriterConfig.OpenMode.CREATE);
    return iwc;
  }
View Full Code Here

Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

    }
    dir.close();
  }
 
  public void testSameCodecDifferentInstance() throws Exception {
    Codec codec = new Lucene42Codec() {
      @Override
      public PostingsFormat getPostingsFormatForField(String field) {
        if ("id".equals(field)) {
          return new Pulsing41PostingsFormat(1);
        } else if ("date".equals(field)) {
View Full Code Here

Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

    };
    doTestMixedPostings(codec);
  }
 
  public void testSameCodecDifferentParams() throws Exception {
    Codec codec = new Lucene42Codec() {
      @Override
      public PostingsFormat getPostingsFormatForField(String field) {
        if ("id".equals(field)) {
          return new Pulsing41PostingsFormat(1);
        } else if ("date".equals(field)) {
View Full Code Here

Examples of org.apache.lucene.codecs.lucene42.Lucene42Codec

    dir.close();
  }
 
  private static final class UnRegisteredCodec extends FilterCodec {
    public UnRegisteredCodec() {
      super("NotRegistered", new Lucene42Codec());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.