我有一個關於dismax的問題。如何搜索索爾中的短語
我有這個疑問:
/itas?q=privacy%20policy&debugQuery=true&wt=xml&indent=on&pf=title^99&ps=2&mm=2&ps=2&qs=2
我得到這個reseponse與debugQuery開啓
<lst name="debug">
<str name="rawquerystring">privacy policy</str>
<str name="querystring">privacy policy</str>
<str name="parsedquery">
+((DisjunctionMaxQuery((text:privacy)~0.01) DisjunctionMaxQuery((text:polici)~0.01))~2) DisjunctionMaxQuery((title:"privacy polici"~2^99.0)~0.01)
</str>
<str name="parsedquery_toString">
+(((text:privacy)~0.01 (text:polici)~0.01)~2) (title:"privacy polici"~2^99.0)~0.01
</str>
<lst name="explain">
<str name="http://blah.com/">
0.0 = (MATCH) sum of: 0.0 = (MATCH) sum of: 0.0 = (MATCH) weight(text:privacy in 0), product of: 7.610095E-4 = queryWeight(text:privacy), product of: 1.0009153 = idf(docFreq=1091, maxDocs=1093) 7.603136E-4 = queryNorm 0.0 = (MATCH) fieldWeight(text:privacy in 0), product of: 1.4142135 = tf(termFreq(text:privacy)=2) 1.0009153 = idf(docFreq=1091, maxDocs=1093) 0.0 = fieldNorm(field=text, doc=0) 0.0 = (MATCH) weight(text:polici in 0), product of: 7.6379965E-4 = queryWeight(text:polici), product of: 1.004585 = idf(docFreq=1087, maxDocs=1093) 7.603136E-4 = queryNorm 0.0 = (MATCH) fieldWeight(text:polici in 0), product of: 1.0 = tf(termFreq(text:polici)=1) 1.004585 = idf(docFreq=1087, maxDocs=1093) 0.0 = fieldNorm(field=text, doc=0)
</str>
我看到,在標題中查詢「隱私polici」,但爲什麼parsedquery_toString節在響應中沒有考慮到相同的字符串?一切都分成「隱私」和「政策」
我知道我能做到這一點,但我不想,我想它採取PF但是不知何故,它似乎並沒有這樣做。 – Joyce
鑑於您的查詢指定了pf參數,您不需要明確表示的鄰近查詢,您是正確的。 – Simon
與edismax,有幾種情況下,如果你不明確提供詞組查詢,它不會被添加,例如https://issues.apache.org/jira/browse/SOLR-2988 – Persimmonium