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 <jilal.ouss...@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 <jilal.ouss...@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 <jilal.ouss...@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 <jilal.ouss...@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. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >