Reputation: 61
Using 6.0.1 SOLR. Have got a type declaration:
<fieldType name="customy_icu" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.ICUTokenizerFactory"/>
<filter class="solr.LengthFilterFactory" min="1" max="100"/>
<filter class="solr.NGramTokenizerFactory" minGramSize="2" maxGramSize="20"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.ICUTokenizerFactory"/>
<filter class="solr.LengthFilterFactory" min="1" max="100"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
customy_icu is used for storing text data at hebrew lang (word are reading/writing) from right to left.
When query is "מי פנים" I have got the result in incorrect order, product_3351 is higher (more relevant) than product product_3407, but should be vice versa. Here is debug:
<str name="product_3351">
2.711071 = sum of:
2.711071 = max of:
0.12766865 = weight(meta_keyword:"מי פנים" in 882) [ClassicSimilarity], result of:
0.12766865 = score(doc=882,freq=1.0), product of:
0.05998979 = queryWeight, product of:
8.5126915 = idf(), sum of:
4.7235003 = idf(docFreq=21, docCount=910)
3.7891912 = idf(docFreq=55, docCount=910)
0.0070471005 = queryNorm
2.1281729 = fieldWeight in 882, product of:
1.0 = tf(freq=1.0), with freq of:
1.0 = phraseFreq=1.0
8.5126915 = idf(), sum of:
4.7235003 = idf(docFreq=21, docCount=910)
3.7891912 = idf(docFreq=55, docCount=910)
0.25 = fieldNorm(doc=882)
2.711071 = weight(name:"מי פנים" in 882) [ClassicSimilarity], result of:
2.711071 = score(doc=882,freq=1.0), product of:
0.6178363 = queryWeight, product of:
9.99 = boost
8.776017 = idf(), sum of:
4.8417873 = idf(docFreq=22, docCount=1071)
3.93423 = idf(docFreq=56, docCount=1071)
0.0070471005 = queryNorm
4.3880086 = fieldWeight in 882, product of:
1.0 = tf(freq=1.0), with freq of:
1.0 = phraseFreq=1.0
8.776017 = idf(), sum of:
4.8417873 = idf(docFreq=22, docCount=1071)
3.93423 = idf(docFreq=56, docCount=1071)
0.5 = fieldNorm(doc=882)
</str>
and
<str name="product_3407">
2.711071 = sum of:
2.711071 = max of:
2.711071 = weight(name:"מי פנים" in 919) [ClassicSimilarity], result of:
2.711071 = score(doc=919,freq=1.0), product of:
0.6178363 = queryWeight, product of:
9.99 = boost
8.776017 = idf(), sum of:
4.8417873 = idf(docFreq=22, docCount=1071)
3.93423 = idf(docFreq=56, docCount=1071)
0.0070471005 = queryNorm
4.3880086 = fieldWeight in 919, product of:
1.0 = tf(freq=1.0), with freq of:
1.0 = phraseFreq=1.0
8.776017 = idf(), sum of:
4.8417873 = idf(docFreq=22, docCount=1071)
3.93423 = idf(docFreq=56, docCount=1071)
0.5 = fieldNorm(doc=919)
</str>
The product 3351 has name field value: סאבליים סופט מי פנים And product 3407 has name field value: מי פנים מיסלרים
http://screencast.com/t/2iBwLQqu
How I can boost 3407 product it become higher in result list ?
Thanks a lot!
Upvotes: 0
Views: 958
Reputation: 1953
You can use elevate.xml file to set particular document to appear top in the resultset for specific serachterm.
example :
<elevate>
<query text ="מי פנים">
<doc id="your_product_ID" />
</query>
Upvotes: 0
Reputation: 52792
If you have a specific query where you want to boost a document to the top of the result set, irrelevant of its own score, use the Query Elevation Component.
There is no automagic boosting for "appears earlier in the document", but there's a few ways to work around it. See How to boost scores for early matches for a couple of possible solutions.
"Relevancy" is a fluent term, and you have to implement the kind of scoring that you feel is suitable for your application outside of the standard rules. The debugQuery you've included shows that the documents are scored identically on relevancy by default.
Upvotes: 1