org.apache.lucene.document.Field.setIndexOptions()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.apache.lucene.document.Field.setIndexOptions()方法的一些代码示例,展示了Field.setIndexOptions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.setIndexOptions()方法的具体详情如下:
包路径:org.apache.lucene.document.Field
类名称:Field
方法名:setIndexOptions

Field.setIndexOptions介绍

暂无

代码示例

代码示例来源:origin: org.apache.lucene/lucene-spellchecker

private static Document createDocument(String text, int ng1, int ng2) {
 Document doc = new Document();
 // the word field is never queried on... its indexed so it can be quickly
 // checked for rebuild (and stored for retrieval). Doesn't need norms or TF/pos
 Field f = new Field(F_WORD, text, Field.Store.YES, Field.Index.NOT_ANALYZED);
 f.setIndexOptions(IndexOptions.DOCS_ONLY);
 f.setOmitNorms(true);
 doc.add(f); // orig term
 addGram(text, doc, ng1, ng2);
 return doc;
}

代码示例来源:origin: org.apache.lucene/lucene-spellchecker

ngramField.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
doc.add(ngramField);
if (i == 0) {
 startField.setIndexOptions(IndexOptions.DOCS_ONLY);
 startField.setOmitNorms(true);
 doc.add(startField);
endField.setIndexOptions(IndexOptions.DOCS_ONLY);
endField.setOmitNorms(true);
doc.add(endField);

代码示例来源:origin: org.exoplatform.jcr/exo.jcr.component.core

indexOptions = IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
field.setIndexOptions(indexOptions);
return field;

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
   * Adds a parent child relation to the given <code>doc</code>.
   *
   * @param doc      the document.
   * @param parentId the id of the parent node.
   * @throws ItemStateException  if the parent node cannot be read.
   * @throws RepositoryException if the parent node does not have a child node
   *                             entry for the current node.
   */
  protected void addParentChildRelation(Document doc,
                     NodeId parentId)
      throws ItemStateException, RepositoryException {
    Field parentField = new Field(FieldNames.PARENT, false,
        parentId.toString(), Field.Store.YES,
        Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO);
    parentField.setIndexOptions(FieldInfo.IndexOptions.DOCS_ONLY);
    doc.add(parentField);
    NodeState parent = (NodeState) stateProvider.getItemState(parentId);
    ChildNodeEntry child = parent.getChildNodeEntry(node.getNodeId());
    if (child == null) {
      // this can only happen when jackrabbit
      // is running in a cluster.
      throw new RepositoryException(
          "Missing child node entry for node with id: "
          + node.getNodeId());
    }
    Name name = child.getName();
    addNodeName(doc, name.getNamespaceURI(), name.getLocalName());
  }
}

代码示例来源:origin: apache/jackrabbit

/**
   * Adds a parent child relation to the given <code>doc</code>.
   *
   * @param doc      the document.
   * @param parentId the id of the parent node.
   * @throws ItemStateException  if the parent node cannot be read.
   * @throws RepositoryException if the parent node does not have a child node
   *                             entry for the current node.
   */
  protected void addParentChildRelation(Document doc,
                     NodeId parentId)
      throws ItemStateException, RepositoryException {
    Field parentField = new Field(FieldNames.PARENT, false,
        parentId.toString(), Field.Store.YES,
        Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO);
    parentField.setIndexOptions(FieldInfo.IndexOptions.DOCS_ONLY);
    doc.add(parentField);
    NodeState parent = (NodeState) stateProvider.getItemState(parentId);
    ChildNodeEntry child = parent.getChildNodeEntry(node.getNodeId());
    if (child == null) {
      // this can only happen when jackrabbit
      // is running in a cluster.
      throw new RepositoryException(
          "Missing child node entry for node with id: "
          + node.getNodeId());
    }
    Name name = child.getName();
    addNodeName(doc, name.getNamespaceURI(), name.getLocalName());
  }
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS,
    Field.TermVector.NO);
parent.setIndexOptions(FieldInfo.IndexOptions.DOCS_ONLY);
doc.add(parent);
addNodeName(doc, "", "");

代码示例来源:origin: apache/jackrabbit

Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS,
    Field.TermVector.NO);
parent.setIndexOptions(FieldInfo.IndexOptions.DOCS_ONLY);
doc.add(parent);
addNodeName(doc, "", "");

相关文章