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 Bagesh Sharma <ma...@gmail.com> on 2011/02/04 08:44:40 UTC
Problem in faceting
Dear sir, i have problem with faceting.
I am searching a text "water treatment plant" on solr using dismax request
handler.
The final query which goes to solr is here -
<str name="parsedquery_toString">
+((TDR_SUBIND_PROD_NAMES:water^2.5 | TDR_SUBIND_LOC_ZIP:water^2.5 |
TDR_SUBIND_COMP_NAME:water^1.5 | TDR_SUBIND_TENDER_NO:water |
TDR_SUBIND_SUBTDR_SHORT:water^3.0 | TDR_SUBIND_SUBTDR_DETAILS:water^2.0 |
TDR_SUBIND_LOC_CITY:water^3.0 | TDR_SUBIND_LOC_STATE:water^3.0 |
TDR_SUBIND_NAME:water^1.5)~0.2 (TDR_SUBIND_PROD_NAMES:treatment^2.5 |
TDR_SUBIND_LOC_ZIP:treatment^2.5 | TDR_SUBIND_COMP_NAME:treatment^1.5 |
TDR_SUBIND_TENDER_NO:treatment | TDR_SUBIND_SUBTDR_SHORT:treatment^3.0 |
TDR_SUBIND_SUBTDR_DETAILS:treatment^2.0 | TDR_SUBIND_LOC_CITY:treatment^3.0
| TDR_SUBIND_LOC_STATE:treatment^3.0 | TDR_SUBIND_NAME:treatment^1.5)~0.2
(TDR_SUBIND_PROD_NAMES:plant^2.5 | TDR_SUBIND_LOC_ZIP:plant^2.5 |
TDR_SUBIND_COMP_NAME:plant^1.5 | TDR_SUBIND_TENDER_NO:plant |
TDR_SUBIND_SUBTDR_SHORT:plant^3.0 | TDR_SUBIND_SUBTDR_DETAILS:plant^2.0 |
TDR_SUBIND_LOC_CITY:plant^3.0 | TDR_SUBIND_LOC_STATE:plant^3.0 |
TDR_SUBIND_NAME:plant^1.5)~0.2) (TDR_SUBIND_SUBTDR_DETAILS:"water treatment
plant"^10.0 | TDR_SUBIND_COMP_NAME:"water treatment plant"^20.0 |
TDR_SUBIND_SUBTDR_SHORT:"water treatment plant"^15.0)~0.2
</str>
Now i want to do faceting over those results which have complete text "water
treatment plant " in it. means the records which have "water treatment
plant" completely. i donot want to do faceting on the results which has 1 or
2 words matching like "water" or "treatment". But in case of above query i
am not able to achieve this thing.
The Main Problem :
There is a field FACET_CITY in my schema.xml and i want to find out only
those cities for which the complete text "water treatment plant" should
match. I don't want those cities for which only "water" or "treatment" words
are matching.
I have two possibilities to achieve this functionality -
1. Either anyhow i can find out the cities list for which the complete text
is matching means faceting only on complete text matching documents
OR
2. Faceting over first 100 documents only for cities list. It may be for
first 100 documents having more score.
Please Suggest me how can i achieve this.
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-in-faceting-tp2422182p2422182.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Problem in faceting
Posted by Grijesh <pi...@gmail.com>.
Try solr's new Local Params ,may that will help for your requirement.
http://wiki.apache.org/solr/LocalParams
-----
Thanx:
Grijesh
http://lucidimagination.com
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-in-faceting-tp2422182p2422534.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Problem in faceting
Posted by Bagesh Sharma <ma...@gmail.com>.
But i want results as it is as the above query is returning. There is no
problem with the results with it is returning.
Problem detail
I have implemented search for my company in which in search box user can
search any query. Now when a user search "water treatment plant". Then the
results come back according to above given query in which the documents
containing words "water" or "treatment" or "plant" or "water treatment
plant" is matching. All these searched results are correct and fulfill my
requirements . Along with these results i am doing faceting over cities to
display. Currently all cities are displayed if they are of a record matching
with any word "water" or "treatment" or "plant" or "water treatment plant".
But now my requirement is to keep the records as it is but do faceting over
only those cities for which complete text "water treatment plant" is
matching.
Is it possible by a single query to solr please suggest. Thanks a lot for
your response.
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-in-faceting-tp2422182p2422353.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Problem in faceting
Posted by Grijesh <pi...@gmail.com>.
change the default operator from "OR" to "AND" by using q.op or in schema
-----
Thanx:
Grijesh
http://lucidimagination.com
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-in-faceting-tp2422182p2422228.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Problem in faceting
Posted by Bagesh Sharma <ma...@gmail.com>.
Sending two separate queries is an approach but i think it may affect
performance of the solr because for every new search there will be two
queries to solr due to this reason i was thinking to do it by a single
query. I am going to implement it with two queries now but if any thing is
found useful in future then suggest me please. Thanks for the suggestion
--
Thanks and Regards
Bagesh Sharma
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-in-faceting-tp2422182p2424104.html
Sent from the Solr - User mailing list archive at Nabble.com.
RE: Problem in faceting
Posted by Pierre GOSSE <pi...@arisem.com>.
Yes, I see I didn't understand that facet.query parameter.
Have you consider submitting two queries ? One for results with q.op=OR, one for faceting with q.op=AND ?
-----Message d'origine-----
De : Grijesh [mailto:pintu.grijesh@gmail.com]
Envoyé : vendredi 4 février 2011 10:42
À : solr-user@lucene.apache.org
Objet : RE: Problem in faceting
facet.query=+water +treatement +plant will not return the city facet that is
needed by poster.
That will give the counts matching the query facet.query=+water +treatement
+plant only
-----
Thanx:
Grijesh
http://lucidimagination.com
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-in-faceting-tp2422182p2422881.html
Sent from the Solr - User mailing list archive at Nabble.com.
RE: Problem in faceting
Posted by Grijesh <pi...@gmail.com>.
facet.query=+water +treatement +plant will not return the city facet that is
needed by poster.
That will give the counts matching the query facet.query=+water +treatement
+plant only
-----
Thanx:
Grijesh
http://lucidimagination.com
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-in-faceting-tp2422182p2422881.html
Sent from the Solr - User mailing list archive at Nabble.com.
RE: Problem in faceting
Posted by Pierre GOSSE <pi...@arisem.com>.
Using a facet query like
facet.query=+water +treatement +plant
... should give a count of 0 to documents not having all tree terms. This could do the trick, if I understand how this parameter works.