当前位置:网站首页>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());
}边栏推荐
- 为什么说数据服务化是下一代数据中台的方向?
- 专题 | 同步 异步
- PgSQL converts string to double type (to_number())
- La différence entre le let Typescript et le Var
- Store WordPress media content on 4everland to complete decentralized storage
- Download address collection of various versions of devaexpress
- Summary of Arduino serial functions related to print read
- Grpc message sending of vertx
- Vertx multi vertical shared data
- TreeMap
猜你喜欢

Circuit, packet and message exchange

Recursion, Fibonacci sequence

File operation serialization recursive copy

VMware network mode - bridge, host only, NAT network

Use of other streams

SecureCRT取消Session记录的密码

Introduction of transformation flow

Map interface and method

IP home online query platform

Pat grade a real problem 1166
随机推荐
Operation and maintenance technical support personnel have hardware maintenance experience in Hong Kong
2021-07-18
Margin left: -100% understanding in the Grail layout
Hello world of vertx
Common methods of file class
[set theory] Stirling subset number (Stirling subset number concept | ball model | Stirling subset number recurrence formula | binary relationship refinement relationship of division)
Use of file class
Common operations of JSP
Dora (discover offer request recognition) process of obtaining IP address
"Moss ma not found" solution
URL programming
Vertx's responsive redis client
Chapter VI - Containers
pgAdmin 4 v6.11 发布,PostgreSQL 开源图形化管理工具
The difference between typescript let and VaR
Map interface and method
"Baidu Cup" CTF game 2017 February, Web: blast-1
不出网上线CS的各种姿势
1. E-commerce tool cefsharp autojs MySQL Alibaba cloud react C RPA automated script, open source log
【CoppeliaSim4.3】C#调用 remoteApi控制场景中UR5