当前位置: 首页>>代码示例>>Java>>正文


Java FieldSelectorResult类代码示例

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


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

示例1: accept

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
@Override
public FieldSelectorResult accept(String fieldName) {
    for (Term t : terms) {
        if (fieldName == t.field()) {
            return FieldSelectorResult.LOAD;
        }
    }
    return FieldSelectorResult.NO_LOAD;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:Queries.java

示例2: accept

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
public FieldSelectorResult accept(String fieldName)
{
    if (fieldName.equals(field))
    {
        return FieldSelectorResult.LOAD;
    }
    else
    {
        return FieldSelectorResult.NO_LOAD;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:ReferenceCountingReadOnlyIndexReaderFactory.java

示例3: accept

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
@Override
public FieldSelectorResult accept(String fieldName)
{
	if( FreeTextQuery.FIELD_ID.equals(fieldName) )
	{
		return FieldSelectorResult.LOAD_AND_BREAK;
	}
	else
	{
		return FieldSelectorResult.NO_LOAD;
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:13,代码来源:ItemIndex.java

示例4: accept

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
public FieldSelectorResult accept(String fieldName) {
	if (fieldName.equals("type") || fieldName.equals("fullPath")) {
		return FieldSelectorResult.LOAD;
	}
	
	return FieldSelectorResult.LAZY_LOAD;
}
 
开发者ID:drftpd-ng,项目名称:drftpd3,代码行数:8,代码来源:AdvancedSearchFieldSelector.java

示例5: accept

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
public FieldSelectorResult accept(String fieldName) {
	if (fieldName.equals("fullPath")) {
		return FieldSelectorResult.LOAD;
	}
	
	return FieldSelectorResult.LAZY_LOAD;
}
 
开发者ID:drftpd-ng,项目名称:drftpd3,代码行数:8,代码来源:SimpleSearchFieldSelector.java

示例6: initResultList

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
private List<ResultDocument> initResultList(final Identity identity, final Roles roles, final Query query, final Analyzer analyzer, final Searcher searcher,
        final TopDocs docs, final int firstResult, final int maxReturns, final boolean doHighlight) throws IOException {
    final FieldSelector selector = new FieldSelector() {
        @Override
        public FieldSelectorResult accept(final String fieldName) {
            return (doHighlight || !AbstractOlatDocument.CONTENT_FIELD_NAME.equals(fieldName)) ? FieldSelectorResult.LOAD : FieldSelectorResult.NO_LOAD;
        }
    };

    maxHits = SearchServiceFactory.getService().getSearchModuleConfig().getMaxHits();
    totalHits = docs.totalHits;
    totalDocs = (docs.scoreDocs == null ? 0 : docs.scoreDocs.length);
    final int numOfDocs = Math.min(maxHits, docs.totalHits);
    final List<ResultDocument> res = new ArrayList<ResultDocument>(maxReturns + 1);
    for (int i = firstResult; i < numOfDocs && res.size() < maxReturns; i++) {
        final Document doc = searcher.doc(docs.scoreDocs[i].doc, selector);
        final String reservedTo = doc.get(AbstractOlatDocument.RESERVED_TO);
        if (StringHelper.containsNonWhitespace(reservedTo) && !"public".equals(reservedTo) && !reservedTo.contains(identity.getKey().toString())) {
            continue;// admin cannot see private documents
        }

        final ResultDocument rDoc = createResultDocument(doc, i, query, analyzer, doHighlight, identity, roles);
        if (rDoc != null) {
            res.add(rDoc);
        }

        if (!roles.isOLATAdmin() && i % 10 == 0) {
            // Do commit after certain number of documents because the transaction should not be too big
            DBFactory.getInstance().intermediateCommit();
        }
    }
    return res;
}
 
开发者ID:huihoo,项目名称:olat,代码行数:34,代码来源:SearchResultsImpl.java

示例7: accept

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
@Override
public FieldSelectorResult accept(final String field) {
    if ("id".equals(field)) {
        return FieldSelectorResult.LOAD_AND_BREAK;
    } else {
        return FieldSelectorResult.NO_LOAD;
    }
}
 
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:9,代码来源:IdFieldSelector.java

示例8: ReaderLocal

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
ReaderLocal(IndexConfig indexConfig, IndexDirectory indexDirectory) throws IOException, SearchLibException {
	super(indexConfig);
	spellCheckCache = new SpellCheckCache(100);
	docSetHitsCache = new DocSetHitsCache(indexConfig);
	this.indexDirectory = indexDirectory;
	references = new AtomicInteger(0);
	acquire();
	final Directory directory = indexDirectory.getDirectory();
	if (directory == null)
		throw new IOException("The directory is closed");
	if (indexConfig.isMulti()) {
		final List<String> indexList = indexConfig.getIndexList();
		indexDirectories = new IndexDirectory[indexList.size()];
		indexReaders = new IndexReader[indexList.size()];
		int i = 0;
		for (String indexName : indexList) {
			IndexDirectory indexDir =
					new IndexDirectory(new File(ClientCatalog.getClient(indexName).getDirectory(), "index"));
			indexDirectories[i] = indexDir;
			indexReaders[i++] = IndexReader.open(indexDir.getDirectory());
		}
		indexReader = new MultiReader(indexReaders);
	} else {
		indexReaders = null;
		indexDirectories = null;
		indexReader = IndexReader.open(directory);
	}
	indexSearcher = new IndexSearcher(indexReader);

	final Similarity similarity = indexConfig.getNewSimilarityInstance();
	if (similarity != null)
		indexSearcher.setSimilarity(similarity);

	// Warm
	final TopDocs topDocs = indexSearcher.search(new MatchAllDocsQuery(), 10);
	if (topDocs != null && topDocs.scoreDocs != null)
		for (ScoreDoc scoreDoc : topDocs.scoreDocs)
			indexSearcher.doc(scoreDoc.doc, (FieldSelector) fieldName -> FieldSelectorResult.LOAD);
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:40,代码来源:ReaderLocal.java

示例9: AbstractRevisionFilter

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
public AbstractRevisionFilter(final IssueManager issueManager, final PermissionManager permissionManager, final User user) {
    this.issueManager = issueManager;
    this.permissionManager = permissionManager;
    this.user = user;
    
    issueKeysFieldSelector = new FieldSelector() {
        public FieldSelectorResult accept(String s) {
            return StringUtils.equals(s, CommitIndexer.FIELD_ISSUEKEY)
                    ? FieldSelectorResult.LOAD
                    : FieldSelectorResult.NO_LOAD;
        }
    };
}
 
开发者ID:astralbat,项目名称:gitcommitviewer,代码行数:14,代码来源:AbstractRevisionFilter.java

示例10: accept

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
@Override
public FieldSelectorResult accept(final String fieldName) {
    return FieldSelectorResult.LOAD;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:AllFieldsSelector.java

示例11: accept

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
@Override
public FieldSelectorResult accept(String fieldName) {
	return fieldSet.contains(fieldName) ? FieldSelectorResult.LOAD
			: FieldSelectorResult.NO_LOAD;
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:6,代码来源:FieldSelectors.java

示例12: accept

import org.apache.lucene.document.FieldSelectorResult; //导入依赖的package包/类
@Override
public FieldSelectorResult accept(String fieldName) {
	if (this.name.equals(fieldName))
		return FieldSelectorResult.LOAD;
	return FieldSelectorResult.NO_LOAD;
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:7,代码来源:AbstractField.java


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