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 Oussama Jilal <ji...@gmail.com> on 2013/05/21 18:12:53 UTC

Boosting Documents

Hi everyone,

I have a small (I hope) issue, and I wish someone could point me to the 
right direction.

I have been indexing some documents using Solr 4.1 and specifying 
different "boost"s for different types of documents (boost for the whole 
document). But when searching, I noticed that the scores are the same 
for all of them and that affected the order (not what I wanted).

Does anyone, know if I have to configure something else or what ? I have 
been using Solr for quite some time (more than a year) but I never used 
the boosting feature.

Thanks.

Re: Boosting Documents

Posted by Oussama Jilal <ji...@gmail.com>.
Ok thank you for your help, I think I will have to treat the problem in 
another way even if it will complicate things for me.

thanks again

On 05/22/2013 11:51 AM, Sandeep Mestry wrote:
> I'm running out of options now, can't really see the issue you're facing
> unless the debug analysis is posted.
> I think a thorough debugging is required from both application and solr
> level.
>
> If you want a customize scoring from Solr, you can also consider overriding
> DefaultSimilarity implementation - but that'll be a separate issue.
>
>
> On 22 May 2013 11:32, Oussama Jilal <ji...@gmail.com> wrote:
>
>> Yes I did debug it and there is nothing special about it, everything is
>> treated the same,
>>
>> My Solr version is 4.2
>>
>> The copy field is used because the 2 field are of different types but only
>> one value is indexed in them (so no multiValue is required and it works
>> perfectly).
>>
>>
>>
>>
>> On 05/22/2013 11:18 AM, Sandeep Mestry wrote:
>>
>>> Did you use the debugQuery=true in solr console to see how the query is
>>> being interpreted and the result calculation?
>>>
>>> Also, I'm not sure but this copyfield directive seems a bit confusing to
>>> me..
>>> <copyField  source="Id"  dest="Suggestion"  />
>>> Because multiValued is false for Suggestion field so does that schema mean
>>> Suggestion has value only from Id and not from any other input?
>>>
>>> You haven't mentioned the version of Solr, can you also post the query
>>> params?
>>>
>>>
>>>
>>> On 22 May 2013 11:04, Oussama Jilal <ji...@gmail.com> wrote:
>>>
>>>   I don't know if this can help (since the document boost should be
>>>> independent of any schema) but here is my schema :
>>>>
>>>>          |<?xml version="1.0" encoding="UTF-8"?>
>>>>          <schema  name=""  version="1.5">
>>>>               <types>
>>>>                   <fieldType  name="string"  class="solr.StrField"
>>>>    sortMissingLast="true"  />
>>>>                   <fieldType  name="long"  class="solr.TrieLongField"
>>>>    sortMissingLast="true"  precisionStep="0"  positionIncrementGap="0"  />
>>>>                   <fieldType  name="text"  class="solr.TextField"
>>>>    sortMissingLast="true"  omitNorms="true">
>>>>                       <analyzer  type="index">
>>>>                           <tokenizer  class="solr.****
>>>> KeywordTokenizerFactory"
>>>>    />
>>>>                           <filter  class="solr.****LowerCaseFilterFactory"
>>>>   />
>>>>                           <filter  class="solr.****
>>>> EdgeNGramFilterFactory"
>>>>
>>>>    maxGramSize="255"  />
>>>>                       </analyzer>
>>>>                       <analyzer  type="query">
>>>>                           <tokenizer  class="solr.****
>>>> KeywordTokenizerFactory"
>>>>    />
>>>>                           <filter  class="solr.****LowerCaseFilterFactory"
>>>>   />
>>>>
>>>>                       </analyzer>
>>>>                   </fieldType>
>>>>               </types>
>>>>               <fields>
>>>>                   <field  name="Id"  type="string"  indexed="true"
>>>>    stored="true"  multiValued="false"  required="true"  />
>>>>                   <field  name="Suggestion"  type="text"  indexed="true"
>>>>    stored="true"  multiValued="false"  required="false"  />
>>>>                   <field  name="Type"  type="string"  indexed="true"
>>>>    stored="true"  multiValued="false"  required="true"  />
>>>>                   <field  name="Sections"  type="string"  indexed="true"
>>>>    stored="true"  multiValued="true"  required="false"  />
>>>>                   <field  name="_version_"  type="long"  indexed="true"
>>>>    stored="true"/>
>>>>               </fields>
>>>>               <copyField  source="Id"  dest="Suggestion"  />
>>>>               <uniqueKey>Id</uniqueKey>
>>>>               <defaultSearchField>****Suggestion</****defaultSearchField>
>>>>
>>>>          </schema>|
>>>>
>>>> My query is somthing like : Suggestion:"Olive Oil".
>>>>
>>>> The result is 9 documents, wich all has the same score "11.287682", even
>>>> if they had been indexed with different boosts (I am sure of this).
>>>>
>>>>
>>>>
>>>>
>>>> On 05/22/2013 10:54 AM, Sandeep Mestry wrote:
>>>>
>>>>   I think that is applicable only for the field level boosting and not at
>>>>> document level boosting.
>>>>>
>>>>> Can you post your query, field definition and results you're expecting.
>>>>>
>>>>> I am using index and query time boosting without any issues so far. also
>>>>> which version of Solr you're using?
>>>>>
>>>>>
>>>>> On 22 May 2013 10:44, Oussama Jilal <ji...@gmail.com> wrote:
>>>>>
>>>>>    I don't know if this is the issue or not but, concidering this note
>>>>> from
>>>>>
>>>>>> the wiki :
>>>>>>
>>>>>> NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml)
>>>>>> for any fields where the index-time boost should be stored.
>>>>>>
>>>>>> In my case where I only need to boost the whole document (not a
>>>>>> specific
>>>>>> field), do I have to activate the << omitNorms="false" >> for all the
>>>>>> fields in the schema ?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 05/22/2013 10:41 AM, Oussama Jilal wrote:
>>>>>>
>>>>>>    Thank you Sandeep,
>>>>>>
>>>>>>> I did post the document like that (a minor difference is that I did
>>>>>>> not
>>>>>>> add the boost to the field since I don't want to boost on specific
>>>>>>> field, I
>>>>>>> boosted the whole document '<doc boost="2.0"> .... </doc>'), but the
>>>>>>> issue
>>>>>>> is that everything in the queries results has the same score even if
>>>>>>> they
>>>>>>> had been indexed with different boosts, and I can't sort on another
>>>>>>> field
>>>>>>> since this is independent from any field value.
>>>>>>>
>>>>>>> Any ideas ?
>>>>>>>
>>>>>>> On 05/22/2013 10:30 AM, Sandeep Mestry wrote:
>>>>>>>
>>>>>>>    Hi Oussama,
>>>>>>>
>>>>>>>> This is explained very nicely on Solr Wiki..
>>>>>>>> http://wiki.apache.org/solr/******SolrRelevancyFAQ#index-time_**
>>>>>>>> ****boosts<http://wiki.apache.org/solr/****SolrRelevancyFAQ#index-time_****boosts>
>>>>>>>> <http://wiki.apache.**org/solr/**SolrRelevancyFAQ#**
>>>>>>>> index-time_**boosts<http://wiki.apache.org/solr/**SolrRelevancyFAQ#index-time_**boosts>
>>>>>>>> <http://wiki.apache.org/****solr/SolrRelevancyFAQ#index-****
>>>>>>>> time_boosts<http://wiki.apache.org/**solr/SolrRelevancyFAQ#index-**time_boosts>
>>>>>>>> <http://wiki.**apache.org/solr/**SolrRelevancyFAQ#index-time_**
>>>>>>>> boosts<http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts>
>>>>>>>> http://wiki.apache.org/solr/******UpdateXmlMessages#Optional_****<http://wiki.apache.org/solr/****UpdateXmlMessages#Optional_**>
>>>>>>>> <http://wiki.apache.org/solr/****UpdateXmlMessages#Optional_****<http://wiki.apache.org/solr/**UpdateXmlMessages#Optional_**>
>>>>>>>> attributes_for_.22add.22<http:****//wiki.apache.org/solr/**
>>>>>>>> UpdateXmlMessages#Optional_****attributes_for_.22add.22<http:**
>>>>>>>> //wiki.apache.org/solr/**UpdateXmlMessages#Optional_**
>>>>>>>> attributes_for_.22add.22<http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22>
>>>>>>>>
>>>>>>>> All you need to do is something similar to below..
>>>>>>>>
>>>>>>>>        -
>>>>>>>>
>>>>>>>>        <add>  <doc boost="2.5">    <field
>>>>>>>> name="employeeId">05991</****
>>>>>>>> field>
>>>>>>>>       <field name="office" boost="2.0">Bridgewater</******field>
>>>>>>>>
>>>>>>>> </doc></add>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> What is not clear from your message is whether you need better
>>>>>>>> scoring
>>>>>>>> or
>>>>>>>> better sorting. so, additionally, you can consider adding a secondary
>>>>>>>> sort
>>>>>>>> parameter for the docs having the same score.
>>>>>>>> http://wiki.apache.org/solr/******CommonQueryParameters#sort<http://wiki.apache.org/solr/****CommonQueryParameters#sort>
>>>>>>>> <h**ttp://wiki.apache.org/solr/****CommonQueryParameters#sort<http://wiki.apache.org/solr/**CommonQueryParameters#sort>
>>>>>>>> <htt**p://wiki.apache.org/**solr/**CommonQueryParameters#**sort<http://wiki.apache.org/solr/**CommonQueryParameters#sort>
>>>>>>>> <http://wiki.apache.org/**solr/CommonQueryParameters#**sort<http://wiki.apache.org/solr/CommonQueryParameters#sort>
>>>>>>>>
>>>>>>>>
>>>>>>>> HTH,
>>>>>>>> Sandeep
>>>>>>>>
>>>>>>>>
>>>>>>>> On 22 May 2013 09:21, Oussama Jilal <ji...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>     Thank you for your reply bbarani,
>>>>>>>>
>>>>>>>>   I can't do that because I want to boost some documents over others,
>>>>>>>>> independing of the query.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 05/21/2013 05:41 PM, bbarani wrote:
>>>>>>>>>
>>>>>>>>>       Why don't you boost during query time?
>>>>>>>>>
>>>>>>>>>   Something like q=superman&qf=title^2 subject
>>>>>>>>>> You can refer: http://wiki.apache.org/solr/****
>>>>>>>>>> ****SolrRelevancyFAQ<http://wiki.apache.org/solr/******SolrRelevancyFAQ>
>>>>>>>>>> <http://**wiki.apache.org/solr/******SolrRelevancyFAQ<http://wiki.apache.org/solr/****SolrRelevancyFAQ>
>>>>>>>>>> <http://**wiki.apache.org/**solr/****SolrRelevancyFAQ<http://wiki.apache.org/solr/****SolrRelevancyFAQ>
>>>>>>>>>> <http**://wiki.apache.org/solr/****SolrRelevancyFAQ<http://wiki.apache.org/solr/**SolrRelevancyFAQ>
>>>>>>>>>> <http://wiki.**apache.org/****solr/**SolrRelevancyFAQ<http://apache.org/**solr/**SolrRelevancyFAQ>
>>>>>>>>>> <http:/**/apache.org/solr/****SolrRelevancyFAQ<http://apache.org/solr/**SolrRelevancyFAQ>
>>>>>>>>>> <http:/**/wiki.apache.org/**solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/**SolrRelevancyFAQ>
>>>>>>>>>> <http:/**/wiki.apache.org/solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/SolrRelevancyFAQ>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> View this message in context: http://lucene.472066.n3.**
>>>>>>>>>> nabble.com/Boosting-Documents-********tp4064955p4064966.html<http://nabble.com/Boosting-Documents-******tp4064955p4064966.html>
>>>>>>>>>> <h**ttp://nabble.com/Boosting-**Documents-******
>>>>>>>>>> tp4064955p4064966.html<http://nabble.com/Boosting-Documents-****tp4064955p4064966.html>
>>>>>>>>>> <htt**p://nabble.com/Boosting-****Documents-****
>>>>>>>>>> tp4064955p4064966.**html<http://nabble.com/Boosting-**Documents-**tp4064955p4064966.**html>
>>>>>>>>>> <http:**//nabble.com/Boosting-**Documents-**tp4064955p4064966.**
>>>>>>>>>> html<http://nabble.com/Boosting-Documents-**tp4064955p4064966.html>
>>>>>>>>>> <http:**//lucene.472066.n3.**n**abble.com/**Boosting-****
>>>>>>>>>> Documents-** <http://nabble.com/**Boosting-**Documents-**><
>>>>>>>>>> http://lucene.**472066.n3.nabble.com/****Boosting-Documents-**<http://lucene.472066.n3.nabble.com/**Boosting-Documents-**>
>>>>>>>>>> tp4064955p4064966.html<http://****lucene.472066.n3.nabble.com/****<http://lucene.472066.n3.nabble.com/**>
>>>>>>>>>> Boosting-Documents-****tp4064955p4064966.html<http://**
>>>>>>>>>> lucene.472066.n3.nabble.com/**Boosting-Documents-**
>>>>>>>>>> tp4064955p4064966.html<http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html>
>>>>>>>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>


Re: Boosting Documents

Posted by Sandeep Mestry <sa...@gmail.com>.
I'm running out of options now, can't really see the issue you're facing
unless the debug analysis is posted.
I think a thorough debugging is required from both application and solr
level.

If you want a customize scoring from Solr, you can also consider overriding
DefaultSimilarity implementation - but that'll be a separate issue.


On 22 May 2013 11:32, Oussama Jilal <ji...@gmail.com> wrote:

> Yes I did debug it and there is nothing special about it, everything is
> treated the same,
>
> My Solr version is 4.2
>
> The copy field is used because the 2 field are of different types but only
> one value is indexed in them (so no multiValue is required and it works
> perfectly).
>
>
>
>
> On 05/22/2013 11:18 AM, Sandeep Mestry wrote:
>
>> Did you use the debugQuery=true in solr console to see how the query is
>> being interpreted and the result calculation?
>>
>> Also, I'm not sure but this copyfield directive seems a bit confusing to
>> me..
>> <copyField  source="Id"  dest="Suggestion"  />
>> Because multiValued is false for Suggestion field so does that schema mean
>> Suggestion has value only from Id and not from any other input?
>>
>> You haven't mentioned the version of Solr, can you also post the query
>> params?
>>
>>
>>
>> On 22 May 2013 11:04, Oussama Jilal <ji...@gmail.com> wrote:
>>
>>  I don't know if this can help (since the document boost should be
>>> independent of any schema) but here is my schema :
>>>
>>>         |<?xml version="1.0" encoding="UTF-8"?>
>>>         <schema  name=""  version="1.5">
>>>              <types>
>>>                  <fieldType  name="string"  class="solr.StrField"
>>>   sortMissingLast="true"  />
>>>                  <fieldType  name="long"  class="solr.TrieLongField"
>>>   sortMissingLast="true"  precisionStep="0"  positionIncrementGap="0"  />
>>>                  <fieldType  name="text"  class="solr.TextField"
>>>   sortMissingLast="true"  omitNorms="true">
>>>                      <analyzer  type="index">
>>>                          <tokenizer  class="solr.****
>>> KeywordTokenizerFactory"
>>>   />
>>>                          <filter  class="solr.****LowerCaseFilterFactory"
>>>  />
>>>                          <filter  class="solr.****
>>> EdgeNGramFilterFactory"
>>>
>>>   maxGramSize="255"  />
>>>                      </analyzer>
>>>                      <analyzer  type="query">
>>>                          <tokenizer  class="solr.****
>>> KeywordTokenizerFactory"
>>>   />
>>>                          <filter  class="solr.****LowerCaseFilterFactory"
>>>  />
>>>
>>>                      </analyzer>
>>>                  </fieldType>
>>>              </types>
>>>              <fields>
>>>                  <field  name="Id"  type="string"  indexed="true"
>>>   stored="true"  multiValued="false"  required="true"  />
>>>                  <field  name="Suggestion"  type="text"  indexed="true"
>>>   stored="true"  multiValued="false"  required="false"  />
>>>                  <field  name="Type"  type="string"  indexed="true"
>>>   stored="true"  multiValued="false"  required="true"  />
>>>                  <field  name="Sections"  type="string"  indexed="true"
>>>   stored="true"  multiValued="true"  required="false"  />
>>>                  <field  name="_version_"  type="long"  indexed="true"
>>>   stored="true"/>
>>>              </fields>
>>>              <copyField  source="Id"  dest="Suggestion"  />
>>>              <uniqueKey>Id</uniqueKey>
>>>              <defaultSearchField>****Suggestion</****defaultSearchField>
>>>
>>>         </schema>|
>>>
>>> My query is somthing like : Suggestion:"Olive Oil".
>>>
>>> The result is 9 documents, wich all has the same score "11.287682", even
>>> if they had been indexed with different boosts (I am sure of this).
>>>
>>>
>>>
>>>
>>> On 05/22/2013 10:54 AM, Sandeep Mestry wrote:
>>>
>>>  I think that is applicable only for the field level boosting and not at
>>>> document level boosting.
>>>>
>>>> Can you post your query, field definition and results you're expecting.
>>>>
>>>> I am using index and query time boosting without any issues so far. also
>>>> which version of Solr you're using?
>>>>
>>>>
>>>> On 22 May 2013 10:44, Oussama Jilal <ji...@gmail.com> wrote:
>>>>
>>>>   I don't know if this is the issue or not but, concidering this note
>>>> from
>>>>
>>>>> the wiki :
>>>>>
>>>>> NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml)
>>>>> for any fields where the index-time boost should be stored.
>>>>>
>>>>> In my case where I only need to boost the whole document (not a
>>>>> specific
>>>>> field), do I have to activate the << omitNorms="false" >> for all the
>>>>> fields in the schema ?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 05/22/2013 10:41 AM, Oussama Jilal wrote:
>>>>>
>>>>>   Thank you Sandeep,
>>>>>
>>>>>> I did post the document like that (a minor difference is that I did
>>>>>> not
>>>>>> add the boost to the field since I don't want to boost on specific
>>>>>> field, I
>>>>>> boosted the whole document '<doc boost="2.0"> .... </doc>'), but the
>>>>>> issue
>>>>>> is that everything in the queries results has the same score even if
>>>>>> they
>>>>>> had been indexed with different boosts, and I can't sort on another
>>>>>> field
>>>>>> since this is independent from any field value.
>>>>>>
>>>>>> Any ideas ?
>>>>>>
>>>>>> On 05/22/2013 10:30 AM, Sandeep Mestry wrote:
>>>>>>
>>>>>>   Hi Oussama,
>>>>>>
>>>>>>> This is explained very nicely on Solr Wiki..
>>>>>>> http://wiki.apache.org/solr/******SolrRelevancyFAQ#index-time_**
>>>>>>> ****boosts<http://wiki.apache.org/solr/****SolrRelevancyFAQ#index-time_****boosts>
>>>>>>> <http://wiki.apache.**org/solr/**SolrRelevancyFAQ#**
>>>>>>> index-time_**boosts<http://wiki.apache.org/solr/**SolrRelevancyFAQ#index-time_**boosts>
>>>>>>> >
>>>>>>> <http://wiki.apache.org/****solr/SolrRelevancyFAQ#index-****
>>>>>>> time_boosts<http://wiki.apache.org/**solr/SolrRelevancyFAQ#index-**time_boosts>
>>>>>>> <http://wiki.**apache.org/solr/**SolrRelevancyFAQ#index-time_**
>>>>>>> boosts<http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts>
>>>>>>> >
>>>>>>> http://wiki.apache.org/solr/******UpdateXmlMessages#Optional_****<http://wiki.apache.org/solr/****UpdateXmlMessages#Optional_**>
>>>>>>> <http://wiki.apache.org/solr/****UpdateXmlMessages#Optional_****<http://wiki.apache.org/solr/**UpdateXmlMessages#Optional_**>
>>>>>>> >
>>>>>>> attributes_for_.22add.22<http:****//wiki.apache.org/solr/**
>>>>>>> UpdateXmlMessages#Optional_****attributes_for_.22add.22<http:**
>>>>>>> //wiki.apache.org/solr/**UpdateXmlMessages#Optional_**
>>>>>>> attributes_for_.22add.22<http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22>
>>>>>>> >
>>>>>>>
>>>>>>>
>>>>>>> All you need to do is something similar to below..
>>>>>>>
>>>>>>>       -
>>>>>>>
>>>>>>>       <add>  <doc boost="2.5">    <field
>>>>>>> name="employeeId">05991</****
>>>>>>> field>
>>>>>>>      <field name="office" boost="2.0">Bridgewater</******field>
>>>>>>>
>>>>>>> </doc></add>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> What is not clear from your message is whether you need better
>>>>>>> scoring
>>>>>>> or
>>>>>>> better sorting. so, additionally, you can consider adding a secondary
>>>>>>> sort
>>>>>>> parameter for the docs having the same score.
>>>>>>> http://wiki.apache.org/solr/******CommonQueryParameters#sort<http://wiki.apache.org/solr/****CommonQueryParameters#sort>
>>>>>>> <h**ttp://wiki.apache.org/solr/****CommonQueryParameters#sort<http://wiki.apache.org/solr/**CommonQueryParameters#sort>
>>>>>>> >
>>>>>>> <htt**p://wiki.apache.org/**solr/**CommonQueryParameters#**sort<http://wiki.apache.org/solr/**CommonQueryParameters#sort>
>>>>>>> <http://wiki.apache.org/**solr/CommonQueryParameters#**sort<http://wiki.apache.org/solr/CommonQueryParameters#sort>
>>>>>>> >
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> HTH,
>>>>>>> Sandeep
>>>>>>>
>>>>>>>
>>>>>>> On 22 May 2013 09:21, Oussama Jilal <ji...@gmail.com> wrote:
>>>>>>>
>>>>>>>    Thank you for your reply bbarani,
>>>>>>>
>>>>>>>  I can't do that because I want to boost some documents over others,
>>>>>>>> independing of the query.
>>>>>>>>
>>>>>>>>
>>>>>>>> On 05/21/2013 05:41 PM, bbarani wrote:
>>>>>>>>
>>>>>>>>      Why don't you boost during query time?
>>>>>>>>
>>>>>>>>  Something like q=superman&qf=title^2 subject
>>>>>>>>>
>>>>>>>>> You can refer: http://wiki.apache.org/solr/****
>>>>>>>>> ****SolrRelevancyFAQ<http://wiki.apache.org/solr/******SolrRelevancyFAQ>
>>>>>>>>> <http://**wiki.apache.org/solr/******SolrRelevancyFAQ<http://wiki.apache.org/solr/****SolrRelevancyFAQ>
>>>>>>>>> >
>>>>>>>>> <http://**wiki.apache.org/**solr/****SolrRelevancyFAQ<http://wiki.apache.org/solr/****SolrRelevancyFAQ>
>>>>>>>>> <http**://wiki.apache.org/solr/****SolrRelevancyFAQ<http://wiki.apache.org/solr/**SolrRelevancyFAQ>
>>>>>>>>> >
>>>>>>>>> <http://wiki.**apache.org/****solr/**SolrRelevancyFAQ<http://apache.org/**solr/**SolrRelevancyFAQ>
>>>>>>>>> <http:/**/apache.org/solr/****SolrRelevancyFAQ<http://apache.org/solr/**SolrRelevancyFAQ>
>>>>>>>>> >
>>>>>>>>> <http:/**/wiki.apache.org/**solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/**SolrRelevancyFAQ>
>>>>>>>>> <http:/**/wiki.apache.org/solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/SolrRelevancyFAQ>
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> View this message in context: http://lucene.472066.n3.**
>>>>>>>>> nabble.com/Boosting-Documents-********tp4064955p4064966.html<http://nabble.com/Boosting-Documents-******tp4064955p4064966.html>
>>>>>>>>> <h**ttp://nabble.com/Boosting-**Documents-******
>>>>>>>>> tp4064955p4064966.html<http://nabble.com/Boosting-Documents-****tp4064955p4064966.html>
>>>>>>>>> >
>>>>>>>>> <htt**p://nabble.com/Boosting-****Documents-****
>>>>>>>>> tp4064955p4064966.**html<http://nabble.com/Boosting-**Documents-**tp4064955p4064966.**html>
>>>>>>>>> <http:**//nabble.com/Boosting-**Documents-**tp4064955p4064966.**
>>>>>>>>> html<http://nabble.com/Boosting-Documents-**tp4064955p4064966.html>
>>>>>>>>> >
>>>>>>>>> <http:**//lucene.472066.n3.**n**abble.com/**Boosting-****
>>>>>>>>> Documents-** <http://nabble.com/**Boosting-**Documents-**><
>>>>>>>>> http://lucene.**472066.n3.nabble.com/****Boosting-Documents-**<http://lucene.472066.n3.nabble.com/**Boosting-Documents-**>
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>> tp4064955p4064966.html<http://****lucene.472066.n3.nabble.com/****<http://lucene.472066.n3.nabble.com/**>
>>>>>>>>> Boosting-Documents-****tp4064955p4064966.html<http://**
>>>>>>>>> lucene.472066.n3.nabble.com/**Boosting-Documents-**
>>>>>>>>> tp4064955p4064966.html<http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html>
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>

Re: Boosting Documents

Posted by Oussama Jilal <ji...@gmail.com>.
Yes I did debug it and there is nothing special about it, everything is 
treated the same,

My Solr version is 4.2

The copy field is used because the 2 field are of different types but 
only one value is indexed in them (so no multiValue is required and it 
works perfectly).



On 05/22/2013 11:18 AM, Sandeep Mestry wrote:
> Did you use the debugQuery=true in solr console to see how the query is
> being interpreted and the result calculation?
>
> Also, I'm not sure but this copyfield directive seems a bit confusing to
> me..
> <copyField  source="Id"  dest="Suggestion"  />
> Because multiValued is false for Suggestion field so does that schema mean
> Suggestion has value only from Id and not from any other input?
>
> You haven't mentioned the version of Solr, can you also post the query
> params?
>
>
>
> On 22 May 2013 11:04, Oussama Jilal <ji...@gmail.com> wrote:
>
>> I don't know if this can help (since the document boost should be
>> independent of any schema) but here is my schema :
>>
>>         |<?xml version="1.0" encoding="UTF-8"?>
>>         <schema  name=""  version="1.5">
>>              <types>
>>                  <fieldType  name="string"  class="solr.StrField"
>>   sortMissingLast="true"  />
>>                  <fieldType  name="long"  class="solr.TrieLongField"
>>   sortMissingLast="true"  precisionStep="0"  positionIncrementGap="0"  />
>>                  <fieldType  name="text"  class="solr.TextField"
>>   sortMissingLast="true"  omitNorms="true">
>>                      <analyzer  type="index">
>>                          <tokenizer  class="solr.**KeywordTokenizerFactory"
>>   />
>>                          <filter  class="solr.**LowerCaseFilterFactory"  />
>>                          <filter  class="solr.**EdgeNGramFilterFactory"
>>   maxGramSize="255"  />
>>                      </analyzer>
>>                      <analyzer  type="query">
>>                          <tokenizer  class="solr.**KeywordTokenizerFactory"
>>   />
>>                          <filter  class="solr.**LowerCaseFilterFactory"  />
>>                      </analyzer>
>>                  </fieldType>
>>              </types>
>>              <fields>
>>                  <field  name="Id"  type="string"  indexed="true"
>>   stored="true"  multiValued="false"  required="true"  />
>>                  <field  name="Suggestion"  type="text"  indexed="true"
>>   stored="true"  multiValued="false"  required="false"  />
>>                  <field  name="Type"  type="string"  indexed="true"
>>   stored="true"  multiValued="false"  required="true"  />
>>                  <field  name="Sections"  type="string"  indexed="true"
>>   stored="true"  multiValued="true"  required="false"  />
>>                  <field  name="_version_"  type="long"  indexed="true"
>>   stored="true"/>
>>              </fields>
>>              <copyField  source="Id"  dest="Suggestion"  />
>>              <uniqueKey>Id</uniqueKey>
>>              <defaultSearchField>**Suggestion</**defaultSearchField>
>>         </schema>|
>>
>> My query is somthing like : Suggestion:"Olive Oil".
>>
>> The result is 9 documents, wich all has the same score "11.287682", even
>> if they had been indexed with different boosts (I am sure of this).
>>
>>
>>
>>
>> On 05/22/2013 10:54 AM, Sandeep Mestry wrote:
>>
>>> I think that is applicable only for the field level boosting and not at
>>> document level boosting.
>>>
>>> Can you post your query, field definition and results you're expecting.
>>>
>>> I am using index and query time boosting without any issues so far. also
>>> which version of Solr you're using?
>>>
>>>
>>> On 22 May 2013 10:44, Oussama Jilal <ji...@gmail.com> wrote:
>>>
>>>   I don't know if this is the issue or not but, concidering this note from
>>>> the wiki :
>>>>
>>>> NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml)
>>>> for any fields where the index-time boost should be stored.
>>>>
>>>> In my case where I only need to boost the whole document (not a specific
>>>> field), do I have to activate the << omitNorms="false" >> for all the
>>>> fields in the schema ?
>>>>
>>>>
>>>>
>>>>
>>>> On 05/22/2013 10:41 AM, Oussama Jilal wrote:
>>>>
>>>>   Thank you Sandeep,
>>>>> I did post the document like that (a minor difference is that I did not
>>>>> add the boost to the field since I don't want to boost on specific
>>>>> field, I
>>>>> boosted the whole document '<doc boost="2.0"> .... </doc>'), but the
>>>>> issue
>>>>> is that everything in the queries results has the same score even if
>>>>> they
>>>>> had been indexed with different boosts, and I can't sort on another
>>>>> field
>>>>> since this is independent from any field value.
>>>>>
>>>>> Any ideas ?
>>>>>
>>>>> On 05/22/2013 10:30 AM, Sandeep Mestry wrote:
>>>>>
>>>>>   Hi Oussama,
>>>>>> This is explained very nicely on Solr Wiki..
>>>>>> http://wiki.apache.org/solr/****SolrRelevancyFAQ#index-time_****boosts<http://wiki.apache.org/solr/**SolrRelevancyFAQ#index-time_**boosts>
>>>>>> <http://wiki.apache.org/**solr/SolrRelevancyFAQ#index-**time_boosts<http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts>
>>>>>> http://wiki.apache.org/solr/****UpdateXmlMessages#Optional_**<http://wiki.apache.org/solr/**UpdateXmlMessages#Optional_**>
>>>>>> attributes_for_.22add.22<http:**//wiki.apache.org/solr/**
>>>>>> UpdateXmlMessages#Optional_**attributes_for_.22add.22<http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22>
>>>>>>
>>>>>> All you need to do is something similar to below..
>>>>>>
>>>>>>       -
>>>>>>
>>>>>>       <add>  <doc boost="2.5">    <field name="employeeId">05991</****
>>>>>> field>
>>>>>>      <field name="office" boost="2.0">Bridgewater</****field>
>>>>>> </doc></add>
>>>>>>
>>>>>>
>>>>>>
>>>>>> What is not clear from your message is whether you need better scoring
>>>>>> or
>>>>>> better sorting. so, additionally, you can consider adding a secondary
>>>>>> sort
>>>>>> parameter for the docs having the same score.
>>>>>> http://wiki.apache.org/solr/****CommonQueryParameters#sort<http://wiki.apache.org/solr/**CommonQueryParameters#sort>
>>>>>> <htt**p://wiki.apache.org/solr/**CommonQueryParameters#sort<http://wiki.apache.org/solr/CommonQueryParameters#sort>
>>>>>>
>>>>>>
>>>>>> HTH,
>>>>>> Sandeep
>>>>>>
>>>>>>
>>>>>> On 22 May 2013 09:21, Oussama Jilal <ji...@gmail.com> wrote:
>>>>>>
>>>>>>    Thank you for your reply bbarani,
>>>>>>
>>>>>>> I can't do that because I want to boost some documents over others,
>>>>>>> independing of the query.
>>>>>>>
>>>>>>>
>>>>>>> On 05/21/2013 05:41 PM, bbarani wrote:
>>>>>>>
>>>>>>>      Why don't you boost during query time?
>>>>>>>
>>>>>>>> Something like q=superman&qf=title^2 subject
>>>>>>>>
>>>>>>>> You can refer: http://wiki.apache.org/solr/******SolrRelevancyFAQ<http://wiki.apache.org/solr/****SolrRelevancyFAQ>
>>>>>>>> <http://**wiki.apache.org/solr/****SolrRelevancyFAQ<http://wiki.apache.org/solr/**SolrRelevancyFAQ>
>>>>>>>> <http://wiki.**apache.org/**solr/**SolrRelevancyFAQ<http://apache.org/solr/**SolrRelevancyFAQ>
>>>>>>>> <http:/**/wiki.apache.org/solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/SolrRelevancyFAQ>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context: http://lucene.472066.n3.**
>>>>>>>> nabble.com/Boosting-Documents-******tp4064955p4064966.html<http://nabble.com/Boosting-Documents-****tp4064955p4064966.html>
>>>>>>>> <htt**p://nabble.com/Boosting-**Documents-**tp4064955p4064966.**html<http://nabble.com/Boosting-Documents-**tp4064955p4064966.html>
>>>>>>>> <http:**//lucene.472066.n3.**nabble.com/**Boosting-**Documents-**<http://lucene.472066.n3.nabble.com/**Boosting-Documents-**>
>>>>>>>>
>>>>>>>> tp4064955p4064966.html<http://**lucene.472066.n3.nabble.com/**
>>>>>>>> Boosting-Documents-**tp4064955p4064966.html<http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html>
>>>>>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>>


Re: Boosting Documents

Posted by Sandeep Mestry <sa...@gmail.com>.
Did you use the debugQuery=true in solr console to see how the query is
being interpreted and the result calculation?

Also, I'm not sure but this copyfield directive seems a bit confusing to
me..
<copyField  source="Id"  dest="Suggestion"  />
Because multiValued is false for Suggestion field so does that schema mean
Suggestion has value only from Id and not from any other input?

You haven't mentioned the version of Solr, can you also post the query
params?



On 22 May 2013 11:04, Oussama Jilal <ji...@gmail.com> wrote:

> I don't know if this can help (since the document boost should be
> independent of any schema) but here is my schema :
>
>        |<?xml version="1.0" encoding="UTF-8"?>
>        <schema  name=""  version="1.5">
>             <types>
>                 <fieldType  name="string"  class="solr.StrField"
>  sortMissingLast="true"  />
>                 <fieldType  name="long"  class="solr.TrieLongField"
>  sortMissingLast="true"  precisionStep="0"  positionIncrementGap="0"  />
>                 <fieldType  name="text"  class="solr.TextField"
>  sortMissingLast="true"  omitNorms="true">
>                     <analyzer  type="index">
>                         <tokenizer  class="solr.**KeywordTokenizerFactory"
>  />
>                         <filter  class="solr.**LowerCaseFilterFactory"  />
>                         <filter  class="solr.**EdgeNGramFilterFactory"
>  maxGramSize="255"  />
>                     </analyzer>
>                     <analyzer  type="query">
>                         <tokenizer  class="solr.**KeywordTokenizerFactory"
>  />
>                         <filter  class="solr.**LowerCaseFilterFactory"  />
>                     </analyzer>
>                 </fieldType>
>             </types>
>             <fields>
>                 <field  name="Id"  type="string"  indexed="true"
>  stored="true"  multiValued="false"  required="true"  />
>                 <field  name="Suggestion"  type="text"  indexed="true"
>  stored="true"  multiValued="false"  required="false"  />
>                 <field  name="Type"  type="string"  indexed="true"
>  stored="true"  multiValued="false"  required="true"  />
>                 <field  name="Sections"  type="string"  indexed="true"
>  stored="true"  multiValued="true"  required="false"  />
>                 <field  name="_version_"  type="long"  indexed="true"
>  stored="true"/>
>             </fields>
>             <copyField  source="Id"  dest="Suggestion"  />
>             <uniqueKey>Id</uniqueKey>
>             <defaultSearchField>**Suggestion</**defaultSearchField>
>        </schema>|
>
> My query is somthing like : Suggestion:"Olive Oil".
>
> The result is 9 documents, wich all has the same score "11.287682", even
> if they had been indexed with different boosts (I am sure of this).
>
>
>
>
> On 05/22/2013 10:54 AM, Sandeep Mestry wrote:
>
>> I think that is applicable only for the field level boosting and not at
>> document level boosting.
>>
>> Can you post your query, field definition and results you're expecting.
>>
>> I am using index and query time boosting without any issues so far. also
>> which version of Solr you're using?
>>
>>
>> On 22 May 2013 10:44, Oussama Jilal <ji...@gmail.com> wrote:
>>
>>  I don't know if this is the issue or not but, concidering this note from
>>> the wiki :
>>>
>>> NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml)
>>> for any fields where the index-time boost should be stored.
>>>
>>> In my case where I only need to boost the whole document (not a specific
>>> field), do I have to activate the << omitNorms="false" >> for all the
>>> fields in the schema ?
>>>
>>>
>>>
>>>
>>> On 05/22/2013 10:41 AM, Oussama Jilal wrote:
>>>
>>>  Thank you Sandeep,
>>>>
>>>> I did post the document like that (a minor difference is that I did not
>>>> add the boost to the field since I don't want to boost on specific
>>>> field, I
>>>> boosted the whole document '<doc boost="2.0"> .... </doc>'), but the
>>>> issue
>>>> is that everything in the queries results has the same score even if
>>>> they
>>>> had been indexed with different boosts, and I can't sort on another
>>>> field
>>>> since this is independent from any field value.
>>>>
>>>> Any ideas ?
>>>>
>>>> On 05/22/2013 10:30 AM, Sandeep Mestry wrote:
>>>>
>>>>  Hi Oussama,
>>>>>
>>>>> This is explained very nicely on Solr Wiki..
>>>>> http://wiki.apache.org/solr/****SolrRelevancyFAQ#index-time_****boosts<http://wiki.apache.org/solr/**SolrRelevancyFAQ#index-time_**boosts>
>>>>> <http://wiki.apache.org/**solr/SolrRelevancyFAQ#index-**time_boosts<http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts>
>>>>> >
>>>>> http://wiki.apache.org/solr/****UpdateXmlMessages#Optional_**<http://wiki.apache.org/solr/**UpdateXmlMessages#Optional_**>
>>>>> attributes_for_.22add.22<http:**//wiki.apache.org/solr/**
>>>>> UpdateXmlMessages#Optional_**attributes_for_.22add.22<http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22>
>>>>> >
>>>>>
>>>>>
>>>>> All you need to do is something similar to below..
>>>>>
>>>>>      -
>>>>>
>>>>>      <add>  <doc boost="2.5">    <field name="employeeId">05991</****
>>>>> field>
>>>>>     <field name="office" boost="2.0">Bridgewater</****field>
>>>>> </doc></add>
>>>>>
>>>>>
>>>>>
>>>>> What is not clear from your message is whether you need better scoring
>>>>> or
>>>>> better sorting. so, additionally, you can consider adding a secondary
>>>>> sort
>>>>> parameter for the docs having the same score.
>>>>> http://wiki.apache.org/solr/****CommonQueryParameters#sort<http://wiki.apache.org/solr/**CommonQueryParameters#sort>
>>>>> <htt**p://wiki.apache.org/solr/**CommonQueryParameters#sort<http://wiki.apache.org/solr/CommonQueryParameters#sort>
>>>>> >
>>>>>
>>>>>
>>>>>
>>>>> HTH,
>>>>> Sandeep
>>>>>
>>>>>
>>>>> On 22 May 2013 09:21, Oussama Jilal <ji...@gmail.com> wrote:
>>>>>
>>>>>   Thank you for your reply bbarani,
>>>>>
>>>>>> I can't do that because I want to boost some documents over others,
>>>>>> independing of the query.
>>>>>>
>>>>>>
>>>>>> On 05/21/2013 05:41 PM, bbarani wrote:
>>>>>>
>>>>>>     Why don't you boost during query time?
>>>>>>
>>>>>>> Something like q=superman&qf=title^2 subject
>>>>>>>
>>>>>>> You can refer: http://wiki.apache.org/solr/******SolrRelevancyFAQ<http://wiki.apache.org/solr/****SolrRelevancyFAQ>
>>>>>>> <http://**wiki.apache.org/solr/****SolrRelevancyFAQ<http://wiki.apache.org/solr/**SolrRelevancyFAQ>
>>>>>>> >
>>>>>>> <http://wiki.**apache.org/**solr/**SolrRelevancyFAQ<http://apache.org/solr/**SolrRelevancyFAQ>
>>>>>>> <http:/**/wiki.apache.org/solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/SolrRelevancyFAQ>
>>>>>>> >
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context: http://lucene.472066.n3.**
>>>>>>> nabble.com/Boosting-Documents-******tp4064955p4064966.html<http://nabble.com/Boosting-Documents-****tp4064955p4064966.html>
>>>>>>> <htt**p://nabble.com/Boosting-**Documents-**tp4064955p4064966.**html<http://nabble.com/Boosting-Documents-**tp4064955p4064966.html>
>>>>>>> >
>>>>>>> <http:**//lucene.472066.n3.**nabble.com/**Boosting-**Documents-**<http://lucene.472066.n3.nabble.com/**Boosting-Documents-**>
>>>>>>>
>>>>>>> tp4064955p4064966.html<http://**lucene.472066.n3.nabble.com/**
>>>>>>> Boosting-Documents-**tp4064955p4064966.html<http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html>
>>>>>>> >>
>>>>>>>
>>>>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>>
>

Re: Boosting Documents

Posted by Oussama Jilal <ji...@gmail.com>.
I don't know if this can help (since the document boost should be 
independent of any schema) but here is my schema :

        |<?xml version="1.0" encoding="UTF-8"?>
        <schema  name=""  version="1.5">
             <types>
                 <fieldType  name="string"  class="solr.StrField"  sortMissingLast="true"  />
                 <fieldType  name="long"  class="solr.TrieLongField"  sortMissingLast="true"  precisionStep="0"  positionIncrementGap="0"  />
                 <fieldType  name="text"  class="solr.TextField"  sortMissingLast="true"  omitNorms="true">
                     <analyzer  type="index">
                         <tokenizer  class="solr.KeywordTokenizerFactory"  />
                         <filter  class="solr.LowerCaseFilterFactory"  />
                         <filter  class="solr.EdgeNGramFilterFactory"  maxGramSize="255"  />
                     </analyzer>
                     <analyzer  type="query">
                         <tokenizer  class="solr.KeywordTokenizerFactory"  />
                         <filter  class="solr.LowerCaseFilterFactory"  />
                     </analyzer>
                 </fieldType>
             </types>
             <fields>
                 <field  name="Id"  type="string"  indexed="true"  stored="true"  multiValued="false"  required="true"  />
                 <field  name="Suggestion"  type="text"  indexed="true"  stored="true"  multiValued="false"  required="false"  />
                 <field  name="Type"  type="string"  indexed="true"  stored="true"  multiValued="false"  required="true"  />
                 <field  name="Sections"  type="string"  indexed="true"  stored="true"  multiValued="true"  required="false"  />
                 <field  name="_version_"  type="long"  indexed="true"  stored="true"/>
             </fields>
             <copyField  source="Id"  dest="Suggestion"  />
             <uniqueKey>Id</uniqueKey>
             <defaultSearchField>Suggestion</defaultSearchField>
        </schema>|

My query is somthing like : Suggestion:"Olive Oil".

The result is 9 documents, wich all has the same score "11.287682", even 
if they had been indexed with different boosts (I am sure of this).



On 05/22/2013 10:54 AM, Sandeep Mestry wrote:
> I think that is applicable only for the field level boosting and not at
> document level boosting.
>
> Can you post your query, field definition and results you're expecting.
>
> I am using index and query time boosting without any issues so far. also
> which version of Solr you're using?
>
>
> On 22 May 2013 10:44, Oussama Jilal <ji...@gmail.com> wrote:
>
>> I don't know if this is the issue or not but, concidering this note from
>> the wiki :
>>
>> NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml)
>> for any fields where the index-time boost should be stored.
>>
>> In my case where I only need to boost the whole document (not a specific
>> field), do I have to activate the << omitNorms="false" >> for all the
>> fields in the schema ?
>>
>>
>>
>>
>> On 05/22/2013 10:41 AM, Oussama Jilal wrote:
>>
>>> Thank you Sandeep,
>>>
>>> I did post the document like that (a minor difference is that I did not
>>> add the boost to the field since I don't want to boost on specific field, I
>>> boosted the whole document '<doc boost="2.0"> .... </doc>'), but the issue
>>> is that everything in the queries results has the same score even if they
>>> had been indexed with different boosts, and I can't sort on another field
>>> since this is independent from any field value.
>>>
>>> Any ideas ?
>>>
>>> On 05/22/2013 10:30 AM, Sandeep Mestry wrote:
>>>
>>>> Hi Oussama,
>>>>
>>>> This is explained very nicely on Solr Wiki..
>>>> http://wiki.apache.org/solr/**SolrRelevancyFAQ#index-time_**boosts<http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts>
>>>> http://wiki.apache.org/solr/**UpdateXmlMessages#Optional_**
>>>> attributes_for_.22add.22<http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22>
>>>>
>>>> All you need to do is something similar to below..
>>>>
>>>>      -
>>>>
>>>>      <add>  <doc boost="2.5">    <field name="employeeId">05991</**field>
>>>>     <field name="office" boost="2.0">Bridgewater</**field> </doc></add>
>>>>
>>>>
>>>> What is not clear from your message is whether you need better scoring or
>>>> better sorting. so, additionally, you can consider adding a secondary
>>>> sort
>>>> parameter for the docs having the same score.
>>>> http://wiki.apache.org/solr/**CommonQueryParameters#sort<http://wiki.apache.org/solr/CommonQueryParameters#sort>
>>>>
>>>>
>>>> HTH,
>>>> Sandeep
>>>>
>>>>
>>>> On 22 May 2013 09:21, Oussama Jilal <ji...@gmail.com> wrote:
>>>>
>>>>   Thank you for your reply bbarani,
>>>>> I can't do that because I want to boost some documents over others,
>>>>> independing of the query.
>>>>>
>>>>>
>>>>> On 05/21/2013 05:41 PM, bbarani wrote:
>>>>>
>>>>>     Why don't you boost during query time?
>>>>>> Something like q=superman&qf=title^2 subject
>>>>>>
>>>>>> You can refer: http://wiki.apache.org/solr/****SolrRelevancyFAQ<http://wiki.apache.org/solr/**SolrRelevancyFAQ>
>>>>>> <http://wiki.**apache.org/solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/SolrRelevancyFAQ>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context: http://lucene.472066.n3.**
>>>>>> nabble.com/Boosting-Documents-****tp4064955p4064966.html<http://nabble.com/Boosting-Documents-**tp4064955p4064966.html>
>>>>>> <http:**//lucene.472066.n3.nabble.com/**Boosting-Documents-**
>>>>>> tp4064955p4064966.html<http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html>>
>>>>>>
>>>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>


Re: Boosting Documents

Posted by Sandeep Mestry <sa...@gmail.com>.
I think that is applicable only for the field level boosting and not at
document level boosting.

Can you post your query, field definition and results you're expecting.

I am using index and query time boosting without any issues so far. also
which version of Solr you're using?


On 22 May 2013 10:44, Oussama Jilal <ji...@gmail.com> wrote:

> I don't know if this is the issue or not but, concidering this note from
> the wiki :
>
> NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml)
> for any fields where the index-time boost should be stored.
>
> In my case where I only need to boost the whole document (not a specific
> field), do I have to activate the << omitNorms="false" >> for all the
> fields in the schema ?
>
>
>
>
> On 05/22/2013 10:41 AM, Oussama Jilal wrote:
>
>> Thank you Sandeep,
>>
>> I did post the document like that (a minor difference is that I did not
>> add the boost to the field since I don't want to boost on specific field, I
>> boosted the whole document '<doc boost="2.0"> .... </doc>'), but the issue
>> is that everything in the queries results has the same score even if they
>> had been indexed with different boosts, and I can't sort on another field
>> since this is independent from any field value.
>>
>> Any ideas ?
>>
>> On 05/22/2013 10:30 AM, Sandeep Mestry wrote:
>>
>>> Hi Oussama,
>>>
>>> This is explained very nicely on Solr Wiki..
>>> http://wiki.apache.org/solr/**SolrRelevancyFAQ#index-time_**boosts<http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts>
>>> http://wiki.apache.org/solr/**UpdateXmlMessages#Optional_**
>>> attributes_for_.22add.22<http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22>
>>>
>>> All you need to do is something similar to below..
>>>
>>>     -
>>>
>>>     <add>  <doc boost="2.5">    <field name="employeeId">05991</**field>
>>>    <field name="office" boost="2.0">Bridgewater</**field> </doc></add>
>>>
>>>
>>> What is not clear from your message is whether you need better scoring or
>>> better sorting. so, additionally, you can consider adding a secondary
>>> sort
>>> parameter for the docs having the same score.
>>> http://wiki.apache.org/solr/**CommonQueryParameters#sort<http://wiki.apache.org/solr/CommonQueryParameters#sort>
>>>
>>>
>>> HTH,
>>> Sandeep
>>>
>>>
>>> On 22 May 2013 09:21, Oussama Jilal <ji...@gmail.com> wrote:
>>>
>>>  Thank you for your reply bbarani,
>>>>
>>>> I can't do that because I want to boost some documents over others,
>>>> independing of the query.
>>>>
>>>>
>>>> On 05/21/2013 05:41 PM, bbarani wrote:
>>>>
>>>>    Why don't you boost during query time?
>>>>>
>>>>> Something like q=superman&qf=title^2 subject
>>>>>
>>>>> You can refer: http://wiki.apache.org/solr/****SolrRelevancyFAQ<http://wiki.apache.org/solr/**SolrRelevancyFAQ>
>>>>> <http://wiki.**apache.org/solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/SolrRelevancyFAQ>
>>>>> >
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: http://lucene.472066.n3.**
>>>>> nabble.com/Boosting-Documents-****tp4064955p4064966.html<http://nabble.com/Boosting-Documents-**tp4064955p4064966.html>
>>>>> <http:**//lucene.472066.n3.nabble.com/**Boosting-Documents-**
>>>>> tp4064955p4064966.html<http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html>>
>>>>>
>>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>
>

Re: Boosting Documents

Posted by Oussama Jilal <ji...@gmail.com>.
Oh thank you Chris, this is much clearer, and thank you for updating the 
Wiki too.

On 05/22/2013 08:29 PM, Chris Hostetter wrote:
> : NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml) for
> : any fields where the index-time boost should be stored.
> :
> : In my case where I only need to boost the whole document (not a specific
> : field), do I have to activate the << omitNorms="false" >> for all the fields
> : in the schema ?
>
> docBoost is really just syntactic sugar for a field boost on each field i
> the document -- it's factored into the norm value for each field in the
> document.  (I'll update the wiki to make this more clear)
>
> If you do a query that doesn't utilize any field which has norms, then the
> docBoost you specified when indexing the document never comes into play.
>
>
> In general, doc boosts and field boosts, and the way they come into play
> as part of the field norm is fairly inflexible, and (in my opinion)
> antiquated.  A much better way of dealing with this type of problem is
> also discussed in the section of the wiki you linked to.  Imeediately
> below...
>
> http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts
>
> ...you'll find...
>
> http://wiki.apache.org/solr/SolrRelevancyFAQ#Field_Based_Boosting
>
>
> -Hoss


Re: Boosting Documents

Posted by Chris Hostetter <ho...@fucit.org>.
: NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml) for
: any fields where the index-time boost should be stored.
: 
: In my case where I only need to boost the whole document (not a specific
: field), do I have to activate the << omitNorms="false" >> for all the fields
: in the schema ?

docBoost is really just syntactic sugar for a field boost on each field i 
the document -- it's factored into the norm value for each field in the 
document.  (I'll update the wiki to make this more clear)

If you do a query that doesn't utilize any field which has norms, then the 
docBoost you specified when indexing the document never comes into play.


In general, doc boosts and field boosts, and the way they come into play 
as part of the field norm is fairly inflexible, and (in my opinion) 
antiquated.  A much better way of dealing with this type of problem is 
also discussed in the section of the wiki you linked to.  Imeediately 
below...

http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts

...you'll find...

http://wiki.apache.org/solr/SolrRelevancyFAQ#Field_Based_Boosting


-Hoss

Re: Boosting Documents

Posted by Oussama Jilal <ji...@gmail.com>.
I don't know if this is the issue or not but, concidering this note from 
the wiki :

NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml) 
for any fields where the index-time boost should be stored.

In my case where I only need to boost the whole document (not a specific 
field), do I have to activate the << omitNorms="false" >> for all the 
fields in the schema ?



On 05/22/2013 10:41 AM, Oussama Jilal wrote:
> Thank you Sandeep,
>
> I did post the document like that (a minor difference is that I did 
> not add the boost to the field since I don't want to boost on specific 
> field, I boosted the whole document '<doc boost="2.0"> .... </doc>'), 
> but the issue is that everything in the queries results has the same 
> score even if they had been indexed with different boosts, and I can't 
> sort on another field since this is independent from any field value.
>
> Any ideas ?
>
> On 05/22/2013 10:30 AM, Sandeep Mestry wrote:
>> Hi Oussama,
>>
>> This is explained very nicely on Solr Wiki..
>> http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts
>> http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22 
>>
>>
>> All you need to do is something similar to below..
>>
>>     -
>>
>>     <add>  <doc boost="2.5">    <field name="employeeId">05991</field>
>>    <field name="office" boost="2.0">Bridgewater</field> </doc></add>
>>
>>
>> What is not clear from your message is whether you need better 
>> scoring or
>> better sorting. so, additionally, you can consider adding a secondary 
>> sort
>> parameter for the docs having the same score.
>> http://wiki.apache.org/solr/CommonQueryParameters#sort
>>
>>
>> HTH,
>> Sandeep
>>
>>
>> On 22 May 2013 09:21, Oussama Jilal <ji...@gmail.com> wrote:
>>
>>> Thank you for your reply bbarani,
>>>
>>> I can't do that because I want to boost some documents over others,
>>> independing of the query.
>>>
>>>
>>> On 05/21/2013 05:41 PM, bbarani wrote:
>>>
>>>>   Why don't you boost during query time?
>>>>
>>>> Something like q=superman&qf=title^2 subject
>>>>
>>>> You can refer: 
>>>> http://wiki.apache.org/solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/SolrRelevancyFAQ>
>>>>
>>>>
>>>>
>>>> -- 
>>>> View this message in context: http://lucene.472066.n3.**
>>>> nabble.com/Boosting-Documents-**tp4064955p4064966.html<http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html> 
>>>>
>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>
>>>
>


Re: Boosting Documents

Posted by Oussama Jilal <ji...@gmail.com>.
Thank you Sandeep,

I did post the document like that (a minor difference is that I did not 
add the boost to the field since I don't want to boost on specific 
field, I boosted the whole document '<doc boost="2.0"> .... </doc>'), 
but the issue is that everything in the queries results has the same 
score even if they had been indexed with different boosts, and I can't 
sort on another field since this is independent from any field value.

Any ideas ?

On 05/22/2013 10:30 AM, Sandeep Mestry wrote:
> Hi Oussama,
>
> This is explained very nicely on Solr Wiki..
> http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts
> http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22
>
> All you need to do is something similar to below..
>
>     -
>
>     <add>  <doc boost="2.5">    <field name="employeeId">05991</field>
>    <field name="office" boost="2.0">Bridgewater</field>  </doc></add>
>
>
> What is not clear from your message is whether you need better scoring or
> better sorting. so, additionally, you can consider adding a secondary sort
> parameter for the docs having the same score.
> http://wiki.apache.org/solr/CommonQueryParameters#sort
>
>
> HTH,
> Sandeep
>
>
> On 22 May 2013 09:21, Oussama Jilal <ji...@gmail.com> wrote:
>
>> Thank you for your reply bbarani,
>>
>> I can't do that because I want to boost some documents over others,
>> independing of the query.
>>
>>
>> On 05/21/2013 05:41 PM, bbarani wrote:
>>
>>>   Why don't you boost during query time?
>>>
>>> Something like q=superman&qf=title^2 subject
>>>
>>> You can refer: http://wiki.apache.org/solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/SolrRelevancyFAQ>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://lucene.472066.n3.**
>>> nabble.com/Boosting-Documents-**tp4064955p4064966.html<http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html>
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>


Re: Boosting Documents

Posted by Sandeep Mestry <sa...@gmail.com>.
Hi Oussama,

This is explained very nicely on Solr Wiki..
http://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts
http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22

All you need to do is something similar to below..

   -

   <add>  <doc boost="2.5">    <field name="employeeId">05991</field>
  <field name="office" boost="2.0">Bridgewater</field>  </doc></add>


What is not clear from your message is whether you need better scoring or
better sorting. so, additionally, you can consider adding a secondary sort
parameter for the docs having the same score.
http://wiki.apache.org/solr/CommonQueryParameters#sort


HTH,
Sandeep


On 22 May 2013 09:21, Oussama Jilal <ji...@gmail.com> wrote:

> Thank you for your reply bbarani,
>
> I can't do that because I want to boost some documents over others,
> independing of the query.
>
>
> On 05/21/2013 05:41 PM, bbarani wrote:
>
>>  Why don't you boost during query time?
>>
>> Something like q=superman&qf=title^2 subject
>>
>> You can refer: http://wiki.apache.org/solr/**SolrRelevancyFAQ<http://wiki.apache.org/solr/SolrRelevancyFAQ>
>>
>>
>>
>> --
>> View this message in context: http://lucene.472066.n3.**
>> nabble.com/Boosting-Documents-**tp4064955p4064966.html<http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html>
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>
>

Re: Boosting Documents

Posted by Oussama Jilal <ji...@gmail.com>.
Thank you for your reply bbarani,

I can't do that because I want to boost some documents over others, 
independing of the query.

On 05/21/2013 05:41 PM, bbarani wrote:
> Why don't you boost during query time?
>
> Something like q=superman&qf=title^2 subject
>
> You can refer: http://wiki.apache.org/solr/SolrRelevancyFAQ
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Boosting Documents

Posted by bbarani <bb...@gmail.com>.
Why don't you boost during query time?

Something like q=superman&qf=title^2 subject

You can refer: http://wiki.apache.org/solr/SolrRelevancyFAQ



--
View this message in context: http://lucene.472066.n3.nabble.com/Boosting-Documents-tp4064955p4064966.html
Sent from the Solr - User mailing list archive at Nabble.com.