当前位置:网站首页>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());
}
边栏推荐
猜你喜欢
C代码生产YUV420 planar格式文件
PdfWriter. GetInstance throws system Nullreferenceexception [en] pdfwriter GetInstance throws System. NullRef
Leetcode 198: 打家劫舍
Image recognition and detection -- Notes
IPv4 address
[solved] unknown error 1146
High concurrency memory pool
TCP cumulative acknowledgement and window value update
Sorting, dichotomy
【已解决】SQLException: Invalid value for getInt() - ‘田鹏‘
随机推荐
Advanced API (multithreading 02)
Custom generic structure
【已解决】SQLException: Invalid value for getInt() - ‘田鹏‘
sharepoint 2007 versions
TreeMap
【开发笔记】基于机智云4G转接板GC211的设备上云APP控制
SQL create temporary table
1. E-commerce tool cefsharp autojs MySQL Alibaba cloud react C RPA automated script, open source log
7.2刷题两个
Web router of vertx
高并发内存池
[set theory] order relation (partial order relation | partial order set | example of partial order set)
[most detailed] latest and complete redis interview book (50)
Some experiences of Arduino soft serial port communication
C代码生产YUV420 planar格式文件
Take you through the whole process and comprehensively understand the software accidents that belong to testing
Jeecg menu path display problem
Raspberry pie update tool chain
Wireshark software usage
Common architectures of IO streams