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 andy <yh...@sohu.com> on 2012/08/29 12:00:42 UTC

how to boost given word in a field in the query parameters

Hi All,

I am a Solr newbie,I encountered a problem right now about how to* boost
given word in the field in the query parameter*
the details as follows:
my solr schema as follows

<field name="title" type="text" indexed="true" stored="true"
termVectors="true"/>
<field name="category" type="string" indexed="true" stored="true"/>

category field has certain values ,for examples:307,503,206..

my query like this:q=cell+phone&version=2.2&start=0&rows=10&indent=on
the search result will be in many categories ,for example may be in
206,782,307,289
you know the the default sort which depends on the relevance, *I want  the
result which in category 206 is in front of others*

does anybody know about it

Thanks 
Andy




--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-boost-given-word-in-a-field-in-the-query-parameters-tp4003961.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how to boost given word in a field in the query parameters

Posted by andy <yh...@sohu.com>.

Thanks
Yes, my default operator is AND,if I use OR operator like this:
q=cell phone OR category:206^100 , the results will more than the query
q=cell phone  may be something in the category 206 which don't contains the
cell phone keywords will be included, This is really a  tickler for me



iorixxx wrote
> 
>> Thanks for your reply, if I insert the clause
>> category:206^100 , the search
>> result will only include the results in category 206
>> ?
> 
> It will be an optional clause, unless you have set default operator to AND
> somewhere.
> 
> search results will contain all categories, but 206 will be boosted.
> 




--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-boost-given-word-in-a-field-in-the-query-parameters-tp4003961p4004057.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how to boost given word in a field in the query parameters

Posted by andy <yh...@sohu.com>.
I got it , thanks for ur kindly reply!!!


iorixxx wrote
> 
>> Thanks for your reply, if I insert the clause
>> category:206^100 , the search
>> result will only include the results in category 206
>> ?
> 
> It will be an optional clause, unless you have set default operator to AND
> somewhere.
> 
> search results will contain all categories, but 206 will be boosted.
> 




--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-boost-given-word-in-a-field-in-the-query-parameters-tp4003961p4004061.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how to boost given word in a field in the query parameters

Posted by Ahmet Arslan <io...@yahoo.com>.
> Thanks for your reply, if I insert the clause
> category:206^100 , the search
> result will only include the results in category 206
> ?

It will be an optional clause, unless you have set default operator to AND somewhere.

search results will contain all categories, but 206 will be boosted.



Re: how to boost given word in a field in the query parameters

Posted by andy <yh...@sohu.com>.
Hi iorixxx,

Thanks for your reply, if I insert the clause category:206^100 , the search
result will only include the results in category 206
?

 
iorixxx wrote
> 
>> category field has certain values ,for
>> examples:307,503,206..
>> 
>> my query like
>> this:q=cell+phone&version=2.2&start=0&rows=10&indent=on
>> the search result will be in many categories ,for example
>> may be in
>> 206,782,307,289
>> you know the the default sort which depends on the
>> relevance, *I want  the
>> result which in category 206 is in front of others*
> 
> One way to do this is : add a clause into your query.
> 
> q=cell phone category:206^100
> 



--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-boost-given-word-in-a-field-in-the-query-parameters-tp4003961p4003981.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how to boost given word in a field in the query parameters

Posted by Ahmet Arslan <io...@yahoo.com>.
> category field has certain values ,for
> examples:307,503,206..
> 
> my query like
> this:q=cell+phone&version=2.2&start=0&rows=10&indent=on
> the search result will be in many categories ,for example
> may be in
> 206,782,307,289
> you know the the default sort which depends on the
> relevance, *I want  the
> result which in category 206 is in front of others*

One way to do this is : add a clause into your query.

q=cell phone category:206^100