本文整理汇总了Java中org.apache.solr.search.BitDocSet类的典型用法代码示例。如果您正苦于以下问题:Java BitDocSet类的具体用法?Java BitDocSet怎么用?Java BitDocSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BitDocSet类属于org.apache.solr.search包,在下文中一共展示了BitDocSet类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: AbstractSolrCachingScorer
import org.apache.solr.search.BitDocSet; //导入依赖的package包/类
AbstractSolrCachingScorer(Weight weight, DocSet in, AtomicReaderContext context, Bits acceptDocs, SolrIndexSearcher searcher)
{
super(weight);
this.context = context;
this.acceptDocs = acceptDocs;
if (in instanceof BitDocSet)
{
matches = (BitDocSet) in;
}
else
{
this.matches = new BitDocSet(new FixedBitSet(searcher.maxDoc()));
for (DocIterator it = in.iterator(); it.hasNext(); /* */)
{
matches.addUnique(it.nextDoc());
}
}
bitSet = matches.getBits();
doc = getBase() - 1;
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:23,代码来源:AbstractSolrCachingScorer.java
示例2: createOwnerScorer
import org.apache.solr.search.BitDocSet; //导入依赖的package包/类
public static SolrOwnerScorer createOwnerScorer(Weight weight, AtomicReaderContext context, Bits acceptDocs, SolrIndexSearcher searcher, String authority) throws IOException
{
if (AuthorityType.getAuthorityType(authority) == AuthorityType.USER)
{
DocSet ownedDocs = (DocSet) searcher.cacheLookup(CacheConstants.ALFRESCO_OWNERLOOKUP_CACHE, authority);
if (ownedDocs == null)
{
// Cache miss: query the index for docs where the owner matches the authority.
ownedDocs = searcher.getDocSet(new TermQuery(new Term(QueryConstants.FIELD_OWNER, authority)));
searcher.cacheInsert(CacheConstants.ALFRESCO_OWNERLOOKUP_CACHE, authority, ownedDocs);
}
return new SolrOwnerScorer(weight, ownedDocs, context, acceptDocs, searcher);
}
// Return an empty doc set, as the authority isn't a user.
return new SolrOwnerScorer(weight, new BitDocSet(new FixedBitSet(0)), context, acceptDocs, searcher);
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:19,代码来源:SolrOwnerScorer.java
示例3: AbstractSolrCachingScorer
import org.apache.solr.search.BitDocSet; //导入依赖的package包/类
AbstractSolrCachingScorer(Similarity similarity, DocSet in, SolrIndexReader solrIndexReader)
{
super(similarity);
if (in instanceof BitDocSet)
{
matches = (BitDocSet) in;
}
else
{
this.matches = new BitDocSet(new OpenBitSet(solrIndexReader.maxDoc()));
for (DocIterator it = in.iterator(); it.hasNext(); /* */)
{
matches.addUnique(it.nextDoc());
}
}
openBitSet = matches.getBits();
this.solrIndexReader = solrIndexReader;
doc = solrIndexReader.getBase() - 1;
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:20,代码来源:AbstractSolrCachingScorer.java
示例4: generate
import org.apache.solr.search.BitDocSet; //导入依赖的package包/类
static void generate(int maxSize, int bitsToSet) {
bs = new OpenBitSet(maxSize);
ids = new int[bitsToSet];
int count=0;
if (maxSize>0) {
for (int i=0; i<bitsToSet; i++) {
int id=rand.nextInt(maxSize);
if (!bs.get(id)) {
bs.fastSet(id);
ids[count++]=id;
}
}
}
bds = new BitDocSet(bs,bitsToSet);
hds = new HashDocSet(ids,0,count);
}
开发者ID:pkarmstr,项目名称:NYBC,代码行数:17,代码来源:DocSetPerf.java
示例5: computeGroupedDocSet
import org.apache.solr.search.BitDocSet; //导入依赖的package包/类
private DocSet computeGroupedDocSet(Query query, ProcessedFilter filter, List<Collector> collectors) throws IOException {
Command firstCommand = commands.get(0);
AbstractAllGroupHeadsCollector termAllGroupHeadsCollector =
TermAllGroupHeadsCollector.create(firstCommand.getKey(), firstCommand.getSortWithinGroup());
if (collectors.isEmpty()) {
searchWithTimeLimiter(query, filter, termAllGroupHeadsCollector);
} else {
collectors.add(termAllGroupHeadsCollector);
searchWithTimeLimiter(query, filter, MultiCollector.wrap(collectors.toArray(new Collector[collectors.size()])));
}
return new BitDocSet(termAllGroupHeadsCollector.retrieveGroupHeads(searcher.maxDoc()));
}
开发者ID:europeana,项目名称:search,代码行数:14,代码来源:CommandHandler.java
示例6: createOwnerSetScorer
import org.apache.solr.search.BitDocSet; //导入依赖的package包/类
public static SolrOwnerSetScorer createOwnerSetScorer(SolrIndexSearcher searcher, Similarity similarity, String authorities, SolrIndexReader reader) throws IOException
{
// Get hold of solr top level searcher
// Execute query with caching
// translate reults to leaf docs
// build ordered doc list
BitDocSet authorityOwnedDocs = new BitDocSet(new OpenBitSet(searcher.getReader().maxDoc()));
HashMap<String, OwnerLookUp> ownerLookUp = (HashMap<String, OwnerLookUp>) searcher.cacheLookup(AlfrescoSolrEventListener.ALFRESCO_CACHE,
AlfrescoSolrEventListener.KEY_OWNER_LOOKUP);
String[] auths = authorities.substring(1).split(authorities.substring(0, 1));
for (String current : auths)
{
OwnerLookUp lookUp = ownerLookUp.get(current);
if (lookUp != null)
{
ResizeableArrayList<CacheEntry> indexedOderedByOwnerIdThenDoc = (ResizeableArrayList<CacheEntry>) searcher.cacheLookup(AlfrescoSolrEventListener.ALFRESCO_ARRAYLIST_CACHE,
AlfrescoSolrEventListener.KEY_DBID_LEAF_PATH_BY_OWNER_ID_THEN_LEAF);
for (int i = lookUp.getStart(); i < lookUp.getEnd(); i++)
{
authorityOwnedDocs.addUnique(indexedOderedByOwnerIdThenDoc.get(i).getLeaf());
}
}
}
return new SolrOwnerSetScorer(similarity, authorityOwnedDocs, reader);
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:32,代码来源:SolrOwnerSetScorer.java
示例7: shouldElementBeIgnored
import org.apache.solr.search.BitDocSet; //导入依赖的package包/类
private boolean shouldElementBeIgnored(long dbId, SolrIndexSearcher solrIndexSearcher, DocSet skippingDocs) throws IOException
{
boolean result = false;
if ((skipDescendantAuxDocsForSpecificTypes && !typesForSkippingDescendantAuxDocs.isEmpty())
|| (skipDescendantAuxDocsForSpecificAspects && !aspectsForSkippingDescendantAuxDocs.isEmpty()))
{
BooleanQuery query = new BooleanQuery();
query.add(new TermQuery(new Term(QueryConstants.FIELD_DBID, NumericEncoder.encode(dbId))), Occur.MUST);
DocSet docSet = solrIndexSearcher.getDocSet(query);
int index = -1;
if (docSet instanceof BitDocSet)
{
BitDocSet source = (BitDocSet) docSet;
OpenBitSet openBitSet = source.getBits();
index = openBitSet.nextSetBit(index + 1);
}
else
{
DocIterator it = docSet.iterator();
if (it.hasNext())
{
index = it.nextDoc();
}
}
result = (-1 != index) && skippingDocs.exists(index);
}
return result;
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:34,代码来源:LegacySolrInformationServer.java
示例8: computeDocCorpus
import org.apache.solr.search.BitDocSet; //导入依赖的package包/类
/**
* The set of documents matching the provided 'fq' (filter query). Don't include deleted docs
* either. If null is returned, then all docs are available.
*/
private Bits computeDocCorpus(SolrQueryRequest req) throws SyntaxError, IOException {
final String[] corpusFilterQueries = req.getParams().getParams("fq");
final SolrIndexSearcher searcher = req.getSearcher();
final Bits docBits;
if (corpusFilterQueries != null && corpusFilterQueries.length > 0) {
List<Query> filterQueries = new ArrayList<Query>(corpusFilterQueries.length);
for (String corpusFilterQuery : corpusFilterQueries) {
QParser qParser = QParser.getParser(corpusFilterQuery, null, req);
try {
filterQueries.add(qParser.parse());
} catch (SyntaxError e) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
}
}
final DocSet docSet = searcher.getDocSet(filterQueries);//hopefully in the cache
//note: before Solr 4.7 we could call docSet.getBits() but no longer.
if (docSet instanceof BitDocSet) {
docBits = ((BitDocSet)docSet).getBits();
} else {
docBits = new Bits() {
@Override
public boolean get(int index) {
return docSet.exists(index);
}
@Override
public int length() {
return searcher.maxDoc();
}
};
}
} else {
docBits = searcher.getSlowAtomicReader().getLiveDocs();
}
return docBits;
}
开发者ID:OpenSextant,项目名称:SolrTextTagger,代码行数:43,代码来源:TaggerRequestHandler.java
注:本文中的org.apache.solr.search.BitDocSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论