• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java FieldInfosReader类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.apache.lucene.codecs.FieldInfosReader的典型用法代码示例。如果您正苦于以下问题:Java FieldInfosReader类的具体用法?Java FieldInfosReader怎么用?Java FieldInfosReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

FieldInfosReader类属于org.apache.lucene.codecs包,在下文中一共展示了FieldInfosReader类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getFieldInfosReader

点赞 2

import org.apache.lucene.codecs.FieldInfosReader; //导入依赖的package包/类
@Override
public FieldInfosReader getFieldInfosReader() throws IOException {
  return reader;
}
 

开发者ID:lamsfoundation,
项目名称:lams,
代码行数:5,
代码来源:Lucene40FieldInfosFormat.java

示例2: getFieldInfosReader

点赞 2

import org.apache.lucene.codecs.FieldInfosReader; //导入依赖的package包/类
@Override
public FieldInfosReader getFieldInfosReader() throws IOException {
  return new PreFlexRWFieldInfosReader();
}
 

开发者ID:europeana,
项目名称:search,
代码行数:5,
代码来源:PreFlexRWFieldInfosFormat.java

示例3: getFieldInfosReader

点赞 2

import org.apache.lucene.codecs.FieldInfosReader; //导入依赖的package包/类
@Override
public FieldInfosReader getFieldInfosReader() throws IOException {
  return delegate.getFieldInfosReader();
}
 

开发者ID:europeana,
项目名称:search,
代码行数:5,
代码来源:CrankyFieldInfosFormat.java

示例4: beforeClass

点赞 2

import org.apache.lucene.codecs.FieldInfosReader; //导入依赖的package包/类
/** we will manually instantiate preflex-rw here */
@BeforeClass
public static void beforeClass() throws Exception {
  // NOTE: turn off compound file, this test will open some index files directly.
  LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
  IndexWriterConfig config = newIndexWriterConfig(new MockAnalyzer(random(), MockTokenizer.KEYWORD, false))
                               .setUseCompoundFile(false);
  
  termIndexInterval = config.getTermIndexInterval();
  indexDivisor = TestUtil.nextInt(random(), 1, 10);
  NUMBER_OF_DOCUMENTS = atLeast(100);
  NUMBER_OF_FIELDS = atLeast(Math.max(10, 3*termIndexInterval*indexDivisor/NUMBER_OF_DOCUMENTS));
  
  directory = newDirectory();

  config.setCodec(new PreFlexRWCodec());
  LogMergePolicy mp = newLogMergePolicy();
  // NOTE: turn off compound file, this test will open some index files directly.
  mp.setNoCFSRatio(0.0);
  config.setMergePolicy(mp);

  
  populate(directory, config);

  DirectoryReader r0 = IndexReader.open(directory);
  SegmentReader r = LuceneTestCase.getOnlySegmentReader(r0);
  String segment = r.getSegmentName();
  r.close();

  FieldInfosReader infosReader = new PreFlexRWCodec().fieldInfosFormat().getFieldInfosReader();
  FieldInfos fieldInfos = infosReader.read(directory, segment, "", IOContext.READONCE);
  String segmentFileName = IndexFileNames.segmentFileName(segment, "", Lucene3xPostingsFormat.TERMS_INDEX_EXTENSION);
  long tiiFileLength = directory.fileLength(segmentFileName);
  IndexInput input = directory.openInput(segmentFileName, newIOContext(random()));
  termEnum = new PreflexRWSegmentTermEnum(directory.openInput(IndexFileNames.segmentFileName(segment, "", Lucene3xPostingsFormat.TERMS_EXTENSION), newIOContext(random())), fieldInfos, false);
  int totalIndexInterval = termEnum.indexInterval * indexDivisor;
  
  SegmentTermEnum indexEnum = new PreflexRWSegmentTermEnum(input, fieldInfos, true);
  index = new TermInfosReaderIndex(indexEnum, indexDivisor, tiiFileLength, totalIndexInterval);
  indexEnum.close();
  input.close();
  
  reader = IndexReader.open(directory);
  sampleTerms = sample(random(),reader,1000);
}
 

开发者ID:europeana,
项目名称:search,
代码行数:46,
代码来源:TestTermInfosReaderIndex.java

示例5: readFieldInfos

点赞 2

import org.apache.lucene.codecs.FieldInfosReader; //导入依赖的package包/类
public FieldInfos readFieldInfos(Directory dir, String filename) throws IOException {
  FieldInfosReader reader = Codec.getDefault().fieldInfosFormat().getFieldInfosReader();
  return reader.read(dir, filename, "", IOContext.DEFAULT);
}
 

开发者ID:europeana,
项目名称:search,
代码行数:5,
代码来源:TestFieldInfos.java

示例6: beforeClass

点赞 2

import org.apache.lucene.codecs.FieldInfosReader; //导入依赖的package包/类
/** we will manually instantiate preflex-rw here */
@BeforeClass
public static void beforeClass() throws Exception {
  LuceneTestCase.PREFLEX_IMPERSONATION_IS_ACTIVE = true;
  IndexWriterConfig config = newIndexWriterConfig(TEST_VERSION_CURRENT, 
      new MockAnalyzer(random(), MockTokenizer.KEYWORD, false));
  
  termIndexInterval = config.getTermIndexInterval();
  indexDivisor = _TestUtil.nextInt(random(), 1, 10);
  NUMBER_OF_DOCUMENTS = atLeast(100);
  NUMBER_OF_FIELDS = atLeast(Math.max(10, 3*termIndexInterval*indexDivisor/NUMBER_OF_DOCUMENTS));
  
  directory = newDirectory();

  config.setCodec(new PreFlexRWCodec());
  LogMergePolicy mp = newLogMergePolicy();
  // turn off compound file, this test will open some index files directly.
  mp.setUseCompoundFile(false);
  config.setMergePolicy(mp);

  
  populate(directory, config);

  DirectoryReader r0 = IndexReader.open(directory);
  SegmentReader r = LuceneTestCase.getOnlySegmentReader(r0);
  String segment = r.getSegmentName();
  r.close();

  FieldInfosReader infosReader = new PreFlexRWCodec().fieldInfosFormat().getFieldInfosReader();
  FieldInfos fieldInfos = infosReader.read(directory, segment, IOContext.READONCE);
  String segmentFileName = IndexFileNames.segmentFileName(segment, "", Lucene3xPostingsFormat.TERMS_INDEX_EXTENSION);
  long tiiFileLength = directory.fileLength(segmentFileName);
  IndexInput input = directory.openInput(segmentFileName, newIOContext(random()));
  termEnum = new SegmentTermEnum(directory.openInput(IndexFileNames.segmentFileName(segment, "", Lucene3xPostingsFormat.TERMS_EXTENSION), newIOContext(random())), fieldInfos, false);
  int totalIndexInterval = termEnum.indexInterval * indexDivisor;
  
  SegmentTermEnum indexEnum = new SegmentTermEnum(input, fieldInfos, true);
  index = new TermInfosReaderIndex(indexEnum, indexDivisor, tiiFileLength, totalIndexInterval);
  indexEnum.close();
  input.close();
  
  reader = IndexReader.open(directory);
  sampleTerms = sample(random(),reader,1000);
}
 

开发者ID:pkarmstr,
项目名称:NYBC,
代码行数:45,
代码来源:TestTermInfosReaderIndex.java

示例7: readFieldInfos

点赞 2

import org.apache.lucene.codecs.FieldInfosReader; //导入依赖的package包/类
public FieldInfos readFieldInfos(Directory dir, String filename) throws IOException {
  FieldInfosReader reader = Codec.getDefault().fieldInfosFormat().getFieldInfosReader();
  return reader.read(dir, filename, IOContext.DEFAULT);
}
 

开发者ID:pkarmstr,
项目名称:NYBC,
代码行数:5,
代码来源:TestFieldInfos.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)