这里提出了类似的问题:
从 Lucene 查找搜索命中的位置
我的问题是,该链接已有 3 年历史,大多数方法已被弃用,或者 Lucene 4.4 或 4.5 甚至不存在。起初我认为explain()
方法应该包括所有内容,但它确实不是(或者我看不到)这是我从explain()
方法中得到的。我真的看不到任何有关职位的信息:
0.40144306 = (MATCH) sum of:
0.13381435 = (MATCH) weight(contents:inb344 in 52) [DefaultSimilarity], result of:
0.13381435 = score(doc=52,freq=1.0 = termFreq=1.0
), product of:
0.4472136 = queryWeight, product of:
9.574976 = idf(docFreq=44, maxDocs=238384)
0.046706498 = queryNorm
0.299218 = fieldWeight in 52, product of:
1.0 = tf(freq=1.0), with freq of:
1.0 = termFreq=1.0
9.574976 = idf(docFreq=44, maxDocs=238384)
0.03125 = fieldNorm(doc=52)
0.2676287 = (MATCH) weight(contents:inb344^2.0 in 52) [DefaultSimilarity], result of:
0.2676287 = score(doc=52,freq=1.0 = termFreq=1.0
), product of:
0.8944272 = queryWeight, product of:
2.0 = boost
9.574976 = idf(docFreq=44, maxDocs=238384)
0.046706498 = queryNorm
0.299218 = fieldWeight in 52, product of:
1.0 = tf(freq=1.0), with freq of:
1.0 = termFreq=1.0
9.574976 = idf(docFreq=44, maxDocs=238384)
0.03125 = fieldNorm(doc=52)
有没有办法查看给定文档的查询的现有位置(可能是开始和结束位置)?