本文整理匯總了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));
}
示例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));
}
示例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));
}
示例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;
}
示例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);
}
示例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);
}