当前位置:网站首页>Application of pigeon nest principle in Lucene minshouldmatchsumscorer
Application of pigeon nest principle in Lucene minshouldmatchsumscorer
2022-07-03 07:29:00 【chuanyangwang】


@Override
public int nextDoc() throws IOException {
// We are moving to the next doc ID, so scorers in 'lead' need to go in
// 'tail'. If there is not enough space in 'tail', then we take the least
// costly scorers and advance them.
for (DisiWrapper s = lead; s != null; s = s.next) {
final DisiWrapper evicted = insertTailWithOverFlow(s);
if (evicted != null) {
if (evicted.doc == doc) {
evicted.doc = evicted.iterator.nextDoc();
} else {
evicted.doc = evicted.iterator.advance(doc + 1);
}
head.add(evicted);
}
}
setDocAndFreq();
// It would be correct to return doNextCandidate() at this point but if you
// call nextDoc as opposed to advance, it probably means that you really
// need the next match. Returning 'doc' here would lead to a similar
// iteration over sub postings overall except that the decision making would
// happen at a higher level where more abstractions are involved and
// benchmarks suggested it causes a significant performance hit.
return doNext();
}freq+tailSize >= minShouldMatch To ensure the head It won't spill
private int doNext() throws IOException {
while (freq < minShouldMatch) {
assert freq > 0;
if (freq + tailSize >= minShouldMatch) {
// a match on doc is still possible, try to
// advance scorers from the tail
advanceTail();
} else {
// no match on doc is possible anymore, move to the next potential match
pushBackLeads();
setDocAndFreq();
}
}
return doc;
}org.apache.lucene.codecs.lucene80.Lucene80DocValuesProducer
@Override
public long nextOrd() throws IOException {
if (set == false) {
final int index = disi.index();
final long start = addresses.get(index);
this.start = start + 1;
end = addresses.get(index + 1L);
set = true;
return ords.get(start);
} else if (start == end) {
return NO_MORE_ORDS;
} else {
return ords.get(start++);
}
} @Override
public int ordValue() {
return (int) ords.get(disi.index());
}边栏推荐
猜你喜欢

Take you through the whole process and comprehensively understand the software accidents that belong to testing

《指環王:力量之戒》新劇照 力量之戒鑄造者亮相

C code production YUV420 planar format file

Introduction of transformation flow

SecureCRT password to cancel session recording

Use of other streams
![[set theory] Stirling subset number (Stirling subset number concept | ball model | Stirling subset number recurrence formula | binary relationship refinement relationship of division)](/img/d8/b4f39d9637c9886a8c81ca125d6944.jpg)
[set theory] Stirling subset number (Stirling subset number concept | ball model | Stirling subset number recurrence formula | binary relationship refinement relationship of division)

VMWare网络模式-桥接,Host-Only,NAT网络

Homology policy / cross domain and cross domain solutions /web security attacks CSRF and XSS

HCIA notes
随机推荐
Hash table, generic
Image recognition and detection -- Notes
TypeScript let与var的区别
Leetcode 198: 打家劫舍
docker建立mysql:5.7版本指定路径挂载不上。
The concept of C language pointer
twenty million two hundred and twenty thousand three hundred and nineteen
Raspberry pie update tool chain
Take you through the whole process and comprehensively understand the software accidents that belong to testing
Visit Google homepage to display this page, which cannot be displayed
【无标题】
2021-07-18
HISAT2 - StringTie - DESeq2 pipeline 进行bulk RNA-seq
Mail sending of vertx
Download address collection of various versions of devaexpress
The difference between typescript let and VaR
Deep learning parameter initialization (I) Xavier initialization with code
Qtip2 solves the problem of too many texts
Common APIs
New stills of Lord of the rings: the ring of strength: the caster of the ring of strength appears