• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PostingsWriterBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: fieldsConsumer

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
  PostingsWriterBase postingsWriter = new Lucene41PostingsWriter(state);

  boolean success = false;
  try {
    FieldsConsumer ret = new BlockTreeTermsWriter(state, 
                                                  postingsWriter,
                                                  minTermBlockSize, 
                                                  maxTermBlockSize);
    success = true;
    return ret;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(postingsWriter);
    }
  }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:Lucene41PostingsFormat.java


示例2: FSTTermsWriter

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
public FSTTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter) throws IOException {
  final String termsFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, TERMS_EXTENSION);

  this.postingsWriter = postingsWriter;
  this.fieldInfos = state.fieldInfos;
  this.out = state.directory.createOutput(termsFileName, state.context);

  boolean success = false;
  try {
    writeHeader(out);
    this.postingsWriter.init(out); 
    success = true;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(out);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:19,代码来源:FSTTermsWriter.java


示例3: FSTOrdTermsWriter

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
public FSTOrdTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter) throws IOException {
  final String termsIndexFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, TERMS_INDEX_EXTENSION);
  final String termsBlockFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, TERMS_BLOCK_EXTENSION);

  this.postingsWriter = postingsWriter;
  this.fieldInfos = state.fieldInfos;

  boolean success = false;
  try {
    this.indexOut = state.directory.createOutput(termsIndexFileName, state.context);
    this.blockOut = state.directory.createOutput(termsBlockFileName, state.context);
    writeHeader(indexOut);
    writeHeader(blockOut);
    this.postingsWriter.init(blockOut); 
    success = true;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(indexOut, blockOut);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:22,代码来源:FSTOrdTermsWriter.java


示例4: fieldsConsumer

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
  PostingsWriterBase postingsWriter = new Lucene41PostingsWriter(state);

  boolean success = false;
  try {
    FieldsConsumer ret = new OrdsBlockTreeTermsWriter(state, 
                                                      postingsWriter,
                                                      minTermBlockSize, 
                                                      maxTermBlockSize);
    success = true;
    return ret;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(postingsWriter);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:19,代码来源:Ords41PostingsFormat.java


示例5: BlockTermsWriter

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
public BlockTermsWriter(TermsIndexWriterBase termsIndexWriter,
    SegmentWriteState state, PostingsWriterBase postingsWriter)
    throws IOException {
  final String termsFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, TERMS_EXTENSION);
  this.termsIndexWriter = termsIndexWriter;
  out = state.directory.createOutput(termsFileName, state.context);
  boolean success = false;
  try {
    fieldInfos = state.fieldInfos;
    writeHeader(out);
    currentField = null;
    this.postingsWriter = postingsWriter;
    // segment = state.segmentName;
    
    //System.out.println("BTW.init seg=" + state.segmentName);
    
    postingsWriter.init(out); // have consumer write its format/header
    success = true;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(out);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:25,代码来源:BlockTermsWriter.java


示例6: fieldsConsumer

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
  PostingsWriterBase docsWriter = null;

  // Terms that have <= freqCutoff number of docs are
  // "pulsed" (inlined):
  PostingsWriterBase pulsingWriter = null;

  // Terms dict
  boolean success = false;
  try {
    docsWriter = wrappedPostingsBaseFormat.postingsWriterBase(state);

    // Terms that have <= freqCutoff number of docs are
    // "pulsed" (inlined):
    pulsingWriter = new PulsingPostingsWriter(state, freqCutoff, docsWriter);
    FieldsConsumer ret = new BlockTreeTermsWriter(state, pulsingWriter, minBlockSize, maxBlockSize);
    success = true;
    return ret;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(docsWriter, pulsingWriter);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:26,代码来源:PulsingPostingsFormat.java


示例7: fieldsConsumer

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
  PostingsWriterBase postingsWriter = new IDVersionPostingsWriter(state);
  boolean success = false;
  try {
    FieldsConsumer ret = new VersionBlockTreeTermsWriter(state, 
                                                         postingsWriter,
                                                         minTermsInBlock, 
                                                         maxTermsInBlock);
    success = true;
    return ret;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(postingsWriter);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:18,代码来源:IDVersionPostingsFormat.java


示例8: fieldsConsumer

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
  if (!LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE) {
    return super.fieldsConsumer(state);
  } else {
    PostingsWriterBase docs = new Lucene40PostingsWriter(state);
    
    // TODO: should we make the terms index more easily
    // pluggable?  Ie so that this codec would record which
    // index impl was used, and switch on loading?
    // Or... you must make a new Codec for this?
    boolean success = false;
    try {
      FieldsConsumer ret = new BlockTreeTermsWriter(state, docs, minBlockSize, maxBlockSize);
      success = true;
      return ret;
    } finally {
      if (!success) {
        docs.close();
      }
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:24,代码来源:Lucene40RWPostingsFormat.java


示例9: BlockTermsWriter

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
public BlockTermsWriter(TermsIndexWriterBase termsIndexWriter,
    SegmentWriteState state, PostingsWriterBase postingsWriter)
    throws IOException {
  final String termsFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, TERMS_EXTENSION);
  this.termsIndexWriter = termsIndexWriter;
  out = state.directory.createOutput(termsFileName, state.context);
  boolean success = false;
  try {
    fieldInfos = state.fieldInfos;
    writeHeader(out);
    currentField = null;
    this.postingsWriter = postingsWriter;
    // segment = state.segmentName;
    
    //System.out.println("BTW.init seg=" + state.segmentName);
    
    postingsWriter.start(out); // have consumer write its format/header
    success = true;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(out);
    }
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:25,代码来源:BlockTermsWriter.java


示例10: fieldsConsumer

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
  PostingsWriterBase docsWriter = null;

  // Terms that have <= freqCutoff number of docs are
  // "pulsed" (inlined):
  PostingsWriterBase pulsingWriter = null;

  // Terms dict
  boolean success = false;
  try {
    docsWriter = wrappedPostingsBaseFormat.postingsWriterBase(state);

    // Terms that have <= freqCutoff number of docs are
    // "pulsed" (inlined):
    pulsingWriter = new PulsingPostingsWriter(freqCutoff, docsWriter);
    FieldsConsumer ret = new BlockTreeTermsWriter(state, pulsingWriter, minBlockSize, maxBlockSize);
    success = true;
    return ret;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(docsWriter, pulsingWriter);
    }
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:26,代码来源:PulsingPostingsFormat.java


示例11: fieldsConsumer

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
  PostingsWriterBase docs = new Lucene40PostingsWriter(state);

  // TODO: should we make the terms index more easily
  // pluggable?  Ie so that this codec would record which
  // index impl was used, and switch on loading?
  // Or... you must make a new Codec for this?
  boolean success = false;
  try {
    FieldsConsumer ret = new BlockTreeTermsWriter(state, docs, minBlockSize, maxBlockSize);
    success = true;
    return ret;
  } finally {
    if (!success) {
      docs.close();
    }
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:20,代码来源:Lucene40RWPostingsFormat.java


示例12: fieldsConsumer

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
  PostingsWriterBase postingsWriter = new Lucene41PostingsWriter(state);

  boolean success = false;
  try {
    FieldsConsumer ret = new FSTOrdTermsWriter(state, postingsWriter);
    success = true;
    return ret;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(postingsWriter);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:16,代码来源:FSTOrdPostingsFormat.java


示例13: fieldsConsumer

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
  PostingsWriterBase postingsWriter = new Lucene41PostingsWriter(state);

  boolean success = false;
  try {
    FieldsConsumer ret = new FSTTermsWriter(state, postingsWriter);
    success = true;
    return ret;
  } finally {
    if (!success) {
      IOUtils.closeWhileHandlingException(postingsWriter);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:16,代码来源:FSTPostingsFormat.java


示例14: TermsWriter

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
TermsWriter(
    TermsIndexWriterBase.FieldWriter fieldIndexWriter,
    FieldInfo fieldInfo,
    PostingsWriterBase postingsWriter) 
{
  this.fieldInfo = fieldInfo;
  this.fieldIndexWriter = fieldIndexWriter;
  pendingTerms = new TermEntry[32];
  for(int i=0;i<pendingTerms.length;i++) {
    pendingTerms[i] = new TermEntry();
  }
  termsStartPointer = out.getFilePointer();
  this.postingsWriter = postingsWriter;
  this.longsSize = postingsWriter.setField(fieldInfo);
}
 
开发者ID:europeana,项目名称:search,代码行数:16,代码来源:BlockTermsWriter.java


示例15: PulsingPostingsWriter

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
/** If the total number of positions (summed across all docs
 *  for this term) is <= maxPositions, then the postings are
 *  inlined into terms dict */
public PulsingPostingsWriter(SegmentWriteState state, int maxPositions, PostingsWriterBase wrappedPostingsWriter) {

  pending = new Position[maxPositions];
  for(int i=0;i<maxPositions;i++) {
    pending[i] = new Position();
  }
  fields = new ArrayList<>();

  // We simply wrap another postings writer, but only call
  // on it when tot positions is >= the cutoff:
  this.wrappedPostingsWriter = wrappedPostingsWriter;
  this.segmentState = state;
}
 
开发者ID:europeana,项目名称:search,代码行数:17,代码来源:PulsingPostingsWriter.java


示例16: TermsWriter

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
TermsWriter(
    TermsIndexWriterBase.FieldWriter fieldIndexWriter,
    FieldInfo fieldInfo,
    PostingsWriterBase postingsWriter) 
{
  this.fieldInfo = fieldInfo;
  this.fieldIndexWriter = fieldIndexWriter;
  pendingTerms = new TermEntry[32];
  for(int i=0;i<pendingTerms.length;i++) {
    pendingTerms[i] = new TermEntry();
  }
  termsStartPointer = out.getFilePointer();
  postingsWriter.setField(fieldInfo);
  this.postingsWriter = postingsWriter;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:16,代码来源:BlockTermsWriter.java


示例17: PulsingPostingsWriter

import org.apache.lucene.codecs.PostingsWriterBase; //导入依赖的package包/类
/** If the total number of positions (summed across all docs
 *  for this term) is <= maxPositions, then the postings are
 *  inlined into terms dict */
public PulsingPostingsWriter(int maxPositions, PostingsWriterBase wrappedPostingsWriter) {
  pending = new Position[maxPositions];
  for(int i=0;i<maxPositions;i++) {
    pending[i] = new Position();
  }

  // We simply wrap another postings writer, but only call
  // on it when tot positions is >= the cutoff:
  this.wrappedPostingsWriter = wrappedPostingsWriter;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:14,代码来源:PulsingPostingsWriter.java



注:本文中的org.apache.lucene.codecs.PostingsWriterBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PsiElementBase类代码示例发布时间:2022-05-22
下一篇:
Java Bundle类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap