當前位置: 首頁>>代碼示例>>Java>>正文


Java MultiFields.getIndexedFields方法代碼示例

本文整理匯總了Java中org.apache.lucene.index.MultiFields.getIndexedFields方法的典型用法代碼示例。如果您正苦於以下問題:Java MultiFields.getIndexedFields方法的具體用法?Java MultiFields.getIndexedFields怎麽用?Java MultiFields.getIndexedFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.lucene.index.MultiFields的用法示例。


在下文中一共展示了MultiFields.getIndexedFields方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: like

import org.apache.lucene.index.MultiFields; //導入方法依賴的package包/類
/**
 * Return a query that will return docs like the passed lucene document ID.
 *
 * @param docNum the documentID of the lucene doc to generate the 'More Like This" query for.
 * @return a query that will return docs like the passed lucene document ID.
 */
public Query like(int docNum) throws IOException {
    if (fieldNames == null) {
        // gather list of valid fields from lucene
        Collection<String> fields = MultiFields.getIndexedFields(ir);
        fieldNames = fields.toArray(new String[fields.size()]);
    }

    return createQuery(retrieveTerms(docNum));
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:16,代碼來源:XMoreLikeThis.java

示例2: like

import org.apache.lucene.index.MultiFields; //導入方法依賴的package包/類
/**
 * Return a query that will return docs like the passed lucene document ID.
 *
 * @param docNum
 *          the documentID of the lucene doc to generate the 'More Like This"
 *          query for.
 * @return a query that will return docs like the passed lucene document ID.
 */
public Query like(int docNum) throws IOException
{
  if (fieldNames == null) {
    // gather list of valid fields from lucene
    Collection<String> fields = MultiFields.getIndexedFields(ir);
    fieldNames = fields.toArray(new String[fields.size()]);
  }

  return createQuery(retrieveTerms(docNum));
}
 
開發者ID:oeuvres,項目名稱:Alix,代碼行數:19,代碼來源:MoreLikeThis.java

示例3: like

import org.apache.lucene.index.MultiFields; //導入方法依賴的package包/類
/**
 * Return a query that will return docs like the passed lucene document ID.
 *
 * @param docNum the documentID of the lucene doc to generate the 'More Like This" query for.
 * @return a query that will return docs like the passed lucene document ID.
 */
public Query like(int docNum) throws IOException {
  if (fieldNames == null) {
    // gather list of valid fields from lucene
    Collection<String> fields = MultiFields.getIndexedFields(ir);
    fieldNames = fields.toArray(new String[fields.size()]);
  }

  return createQuery(retrieveTerms(docNum));
}
 
開發者ID:europeana,項目名稱:search,代碼行數:16,代碼來源:MoreLikeThis.java

示例4: getFieldNames

import org.apache.lucene.index.MultiFields; //導入方法依賴的package包/類
private String[] getFieldNames(IndexReader ir) {
    if (fieldNames == null) {
        // gather list of all valid fields from lucene, if none specified
        Collection<String> fields = MultiFields.getIndexedFields(ir);
        fieldNames = fields.toArray(new String[fields.size()]);
    }

    return fieldNames;
}
 
開發者ID:DiceTechJobs,項目名稱:SolrPlugins,代碼行數:10,代碼來源:FilterSuggesterComponent.java

示例5: QueryAutoStopWordAnalyzer

import org.apache.lucene.index.MultiFields; //導入方法依賴的package包/類
/**
 * Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for all
 * indexed fields from terms with a document frequency greater than the given
 * maxDocFreq
 *
 * @param delegate Analyzer whose TokenStream will be filtered
 * @param indexReader IndexReader to identify the stopwords from
 * @param maxDocFreq Document frequency terms should be above in order to be stopwords
 * @throws IOException Can be thrown while reading from the IndexReader
 */
public QueryAutoStopWordAnalyzer(
    Analyzer delegate,
    IndexReader indexReader,
    int maxDocFreq) throws IOException {
  this(delegate, indexReader, MultiFields.getIndexedFields(indexReader), maxDocFreq);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:17,代碼來源:QueryAutoStopWordAnalyzer.java

示例6: QueryAutoStopWordAnalyzer

import org.apache.lucene.index.MultiFields; //導入方法依賴的package包/類
/**
 * Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for all
 * indexed fields from terms with a document frequency greater than the given
 * maxDocFreq
 *
 * @param matchVersion Version to be used in {@link StopFilter}
 * @param delegate Analyzer whose TokenStream will be filtered
 * @param indexReader IndexReader to identify the stopwords from
 * @param maxDocFreq Document frequency terms should be above in order to be stopwords
 * @throws IOException Can be thrown while reading from the IndexReader
 */
public QueryAutoStopWordAnalyzer(
    Version matchVersion,
    Analyzer delegate,
    IndexReader indexReader,
    int maxDocFreq) throws IOException {
  this(matchVersion, delegate, indexReader, MultiFields.getIndexedFields(indexReader), maxDocFreq);
}
 
開發者ID:pkarmstr,項目名稱:NYBC,代碼行數:19,代碼來源:QueryAutoStopWordAnalyzer.java


注:本文中的org.apache.lucene.index.MultiFields.getIndexedFields方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。