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 "EXTERNAL Taminidi Ravi (ETI, Automotive-Service-Solutions)" <ex...@us.bosch.com> on 2014/02/13 15:09:50 UTC

Multiple Column Condition with Relevance/Rank

Hello, Someone can help me on implementing the below query in Solr, I will using a rank in MS SQL and a return distinct Productid  

Select productid from products where SKU = "101"
Select Productid from products where ManufactureSKU = "101"
Select Productid from product where SKU Like "101%"
Select Productid from Product where ManufactureSKU like "101%"
Select Productid from product where Name Like "101%"
Select Productid from Product where Description like '%101%"

Is there any way in Solr can search the exact match,starts with and anywhere.. in single solr query

Re: Multiple Column Condition with Relevance/Rank

Posted by Tri Cao <tm...@me.com>.
Taminidi,

Relevance ranking is tricky and very domain specific. There are usually multiple ways to do the same thing, each is better at some edge cases and worse at some others :)

It looks to me that you are trying to rank the products by: exact match on SKU, then exact match on ManufactureSKU, then text match on SKU, …, then finally text match on names and description.

One way of doing this is you index your products to fields like exact_sku, text_sku, etc. with the proper text analysis chains. You can then use edismax query, and assign the right weights to these fields, e.g.:

exact_sku^10 text_sku^9 …

Regards,
Tri


On Feb 14, 2014, at 10:11 AM, "EXTERNAL Taminidi Ravi (ETI, Automotive-Service-Solutions)" <ex...@us.bosch.com> wrote:

Thanks for the Info, I am getting all the results, but I need to get the exact match as the first row and after that the near by match. Something like relevance order.


-----Original Message-----
From: Jack Krupansky [mailto:jack@basetechnology.com] 
Sent: Thursday, February 13, 2014 9:17 AM
To: solr-user@lucene.apache.org
Subject: Re: Multiple Column Condition with Relevance/Rank

Use the OR operator between the specific clauses.

-- Jack Krupansky

-----Original Message----- 
From: EXTERNAL Taminidi Ravi (ETI, Automotive-Service-Solutions)
Sent: Thursday, February 13, 2014 9:09 AM
To: solr-user@lucene.apache.org
Subject: Multiple Column Condition with Relevance/Rank


Hello, Someone can help me on implementing the below query in Solr, I will 
using a rank in MS SQL and a return distinct Productid

Select productid from products where SKU = "101"
Select Productid from products where ManufactureSKU = "101"
Select Productid from product where SKU Like "101%"
Select Productid from Product where ManufactureSKU like "101%"
Select Productid from product where Name Like "101%"
Select Productid from Product where Description like '%101%"

Is there any way in Solr can search the exact match,starts with and 
anywhere.. in single solr query 


RE: Multiple Column Condition with Relevance/Rank

Posted by "EXTERNAL Taminidi Ravi (ETI, Automotive-Service-Solutions)" <ex...@us.bosch.com>.
Thanks for the Info, I am getting all the results, but I need to get the exact match as the first row and after that the near by match. Something like relevance order.


-----Original Message-----
From: Jack Krupansky [mailto:jack@basetechnology.com] 
Sent: Thursday, February 13, 2014 9:17 AM
To: solr-user@lucene.apache.org
Subject: Re: Multiple Column Condition with Relevance/Rank

Use the OR operator between the specific clauses.

-- Jack Krupansky

-----Original Message----- 
From: EXTERNAL Taminidi Ravi (ETI, Automotive-Service-Solutions)
Sent: Thursday, February 13, 2014 9:09 AM
To: solr-user@lucene.apache.org
Subject: Multiple Column Condition with Relevance/Rank


Hello, Someone can help me on implementing the below query in Solr, I will 
using a rank in MS SQL and a return distinct Productid

Select productid from products where SKU = "101"
Select Productid from products where ManufactureSKU = "101"
Select Productid from product where SKU Like "101%"
Select Productid from Product where ManufactureSKU like "101%"
Select Productid from product where Name Like "101%"
Select Productid from Product where Description like '%101%"

Is there any way in Solr can search the exact match,starts with and 
anywhere.. in single solr query 


Re: Multiple Column Condition with Relevance/Rank

Posted by Jack Krupansky <ja...@basetechnology.com>.
Use the OR operator between the specific clauses.

-- Jack Krupansky

-----Original Message----- 
From: EXTERNAL Taminidi Ravi (ETI, Automotive-Service-Solutions)
Sent: Thursday, February 13, 2014 9:09 AM
To: solr-user@lucene.apache.org
Subject: Multiple Column Condition with Relevance/Rank


Hello, Someone can help me on implementing the below query in Solr, I will 
using a rank in MS SQL and a return distinct Productid

Select productid from products where SKU = "101"
Select Productid from products where ManufactureSKU = "101"
Select Productid from product where SKU Like "101%"
Select Productid from Product where ManufactureSKU like "101%"
Select Productid from product where Name Like "101%"
Select Productid from Product where Description like '%101%"

Is there any way in Solr can search the exact match,starts with and 
anywhere.. in single solr query