You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Dhanesh Radhakrishnan <dh...@hifx.co.in> on 2015/11/09 11:50:47 UTC

solr search relevancy

Hi,
Can anybody help me to resolve an issues with solr search relevancy.
Problem is that when somebody search "Bank", it displays some other
business related to this phrase.
For Eg it shows  "Blood bank" and "Power bank" as the first results.
To resolve this, we implemented the proximity search at the end of the
phrase for getting the relevancy and boost the field.This eliminate the
issue in search, and irrelevant results goes down to the last sections
For Eg : When a user search "Bank" he gets banks on the top results, not
the "Blood banks".This resolved with proximity in phrases and boosting.

http://stackoverflow.com/questions/12070016/solr-how-to-boost-score-for-early-matches

http://localhost:8983/solr/localbusiness/select?q=((name
:"bank")^300+OR+((categoryPrefixed:"_CATEGORY_PREFIXED_+bank"~1)^300+AND+(categoryPrefixed:"_CATEGORY_PREFIXED_+bank"~2)^200+AND+(categoryPrefixed:"_CATEGORY_PREFIXED_+bank"~3)^100)+OR+
(tag:"bank")^30+OR+(address:"bank")^5)
&start=0&rows=10&wt=json&indent=true


But the actual problem occurred when we sort the search result.

There is a specific requirement from client that the "Premium" listings
should display as top results.For that we have field packageWeight in solr
schema with values  like 10, 20, 30 for free, basic and premium
consecutively.

<field name="packageWeight" type="int" stored="true" indexed="true"
required="true" />
<!-- Used for sorting -->

And now when we perform this sorting, we get some irrelevant results to
top, but its Premium listing.
How this happened is that
In solr schema, there is a field  "tag". A tag is a small summary or words
that used related to the business and can be implemented to provide a quick
overview of the business.
When a search perform based on  "Tag" which is comparatively very low boost.

<field name="tag" type="text_searchable" stored="true" indexed="true"
required="false" multiValued="true" omitNorms="false"
omitTermFreqAndPositions="false" />


In solr doc, there is a premium business named "Mobile Store" and which is
tagged with a keyword "Power Bank".
When we search "Bank" without sorting we are getting relevant results first.
But when we  sort result with field packageWeight, this doc comes first.

Is there any way to resolve this issue??
Or at least is there any way to remove certain fields from the sort, but
not from search.


Regards
dhanesh s r

-- 

------------------------------
IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its 
content are confidential to the intended recipient. If you are not the 
intended recipient, be advised that you have received this e-mail in error 
and that any use, dissemination, forwarding, printing or copying of this 
e-mail is strictly prohibited. It may not be disclosed to or used by anyone 
other than its intended recipient, nor may it be copied in any way. If 
received in error, please email a reply to the sender, then delete it from 
your system. 

Although this e-mail has been scanned for viruses, HiFX cannot ultimately 
accept any responsibility for viruses and it is your responsibility to scan 
attachments (if any).

​
Before you print this email or attachments, please consider the negative 
environmental impacts associated with printing.

Re: solr search relevancy

Posted by Emir Arnautovic <em...@sematext.com>.
Hi Dhanesh,
Several things you could try:
* when you are searching for "bank" you are actually searching for 
tag/category and in your query you are boosting name 300 while tag is 3.
* you must not sort on premium content weight - you can either use boost 
query clauses to prefer premium content
* use elevator component in case you want to explicitly list some 
results for some queries
* take a look at edismax query parser instead of building your own query 
- it gives you nice features you could use here: boost fields, minimum 
terms match, boost queries...

Regards,
Emir

-- 
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com/



On 09.11.2015 11:50, Dhanesh Radhakrishnan wrote:
> Hi,
> Can anybody help me to resolve an issues with solr search relevancy.
> Problem is that when somebody search "Bank", it displays some other
> business related to this phrase.
> For Eg it shows  "Blood bank" and "Power bank" as the first results.
> To resolve this, we implemented the proximity search at the end of the
> phrase for getting the relevancy and boost the field.This eliminate the
> issue in search, and irrelevant results goes down to the last sections
> For Eg : When a user search "Bank" he gets banks on the top results, not
> the "Blood banks".This resolved with proximity in phrases and boosting.
>
> http://stackoverflow.com/questions/12070016/solr-how-to-boost-score-for-early-matches
>
> http://localhost:8983/solr/localbusiness/select?q=((name
> :"bank")^300+OR+((categoryPrefixed:"_CATEGORY_PREFIXED_+bank"~1)^300+AND+(categoryPrefixed:"_CATEGORY_PREFIXED_+bank"~2)^200+AND+(categoryPrefixed:"_CATEGORY_PREFIXED_+bank"~3)^100)+OR+
> (tag:"bank")^30+OR+(address:"bank")^5)
> &start=0&rows=10&wt=json&indent=true
>
>
> But the actual problem occurred when we sort the search result.
>
> There is a specific requirement from client that the "Premium" listings
> should display as top results.For that we have field packageWeight in solr
> schema with values  like 10, 20, 30 for free, basic and premium
> consecutively.
>
> <field name="packageWeight" type="int" stored="true" indexed="true"
> required="true" />
> <!-- Used for sorting -->
>
> And now when we perform this sorting, we get some irrelevant results to
> top, but its Premium listing.
> How this happened is that
> In solr schema, there is a field  "tag". A tag is a small summary or words
> that used related to the business and can be implemented to provide a quick
> overview of the business.
> When a search perform based on  "Tag" which is comparatively very low boost.
>
> <field name="tag" type="text_searchable" stored="true" indexed="true"
> required="false" multiValued="true" omitNorms="false"
> omitTermFreqAndPositions="false" />
>
>
> In solr doc, there is a premium business named "Mobile Store" and which is
> tagged with a keyword "Power Bank".
> When we search "Bank" without sorting we are getting relevant results first.
> But when we  sort result with field packageWeight, this doc comes first.
>
> Is there any way to resolve this issue??
> Or at least is there any way to remove certain fields from the sort, but
> not from search.
>
>
> Regards
> dhanesh s r
>