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 saninfo08 <sa...@gmail.com> on 2015/06/15 09:49:04 UTC

Solr5 search not displaying results based on relevancy

 0
down vote
favorite
	

I am implementing Solr search, the search order is not displaying on the
basis of relevancy. Lets say if use the search keywords as .net ios it's
returning the results based on score. I have a field KeySkills which holds
the following data

KeySkills:Android, ios, Phonegap, ios
KeySkills:.net, .net, .net, MVC, HTML, CSS

Here when i search *.net ios* as search keyword *.net, .net, .net, MVC,
HTML, CSS* should come first in the results and the score should be higher
because it contains .net 3 times, but i am getting reverse result.

Is there any setting needs to be done in solr config file or in schema.xml
file to achieve this or how can i sort the results based on max no of
occurrence of the the text. please help me to solve this.

Following is the result i get

{
"responseHeader": {
"status": 0,
"QTime": 0,
"params": {
 "indent": "true",
 "q": ".net ios",
 "_": "1434345788751",
 "wt": "json"
 }
 },
 "response": {
 "numFound": 2,
 "start": 0,
     "docs": [
    {

    "KeySkills": "Android, ios, Phonegap, ios",
    "_version_": 1504020323727573000,
    "score": 0.47567564

   },
   {

    "KeySkills": "net, net, net, MVC, HTML, CSS",
    "_version_": 1504020323675144200,
    "score": 0.4726259
  }
]
}
}



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr5-search-not-displaying-results-based-on-relevancy-tp4211796.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr5 search not displaying results based on relevancy

Posted by Erick Erickson <er...@gmail.com>.
Also, add &debug=all to your query to see exactly how
scores are calculated.

Best,
Erick

On Mon, Jun 15, 2015 at 3:18 AM, Alessandro Benedetti
<be...@gmail.com> wrote:
> I would really suggest you to take a look to the basics of Lucene scoring.
> As it's evident you have not a clear idea of how the scoring is working.
>
> http://www.solrtutorial.com/solr-search-relevancy.html ( simple but old)
> http://lucene.apache.org/core/5_2_0/core/index.html
>
> After that, take always care about your indexing and querying analysis
> chain, because sometimes it's not matter of scoring.
>
> Cheers
>
>
>
> 2015-06-15 8:49 GMT+01:00 saninfo08 <sa...@gmail.com>:
>
>>  0
>> down vote
>> favorite
>>
>>
>> I am implementing Solr search, the search order is not displaying on the
>> basis of relevancy. Lets say if use the search keywords as .net ios it's
>> returning the results based on score. I have a field KeySkills which holds
>> the following data
>>
>> KeySkills:Android, ios, Phonegap, ios
>> KeySkills:.net, .net, .net, MVC, HTML, CSS
>>
>> Here when i search *.net ios* as search keyword *.net, .net, .net, MVC,
>> HTML, CSS* should come first in the results and the score should be higher
>> because it contains .net 3 times, but i am getting reverse result.
>>
>> Is there any setting needs to be done in solr config file or in schema.xml
>> file to achieve this or how can i sort the results based on max no of
>> occurrence of the the text. please help me to solve this.
>>
>> Following is the result i get
>>
>> {
>> "responseHeader": {
>> "status": 0,
>> "QTime": 0,
>> "params": {
>>  "indent": "true",
>>  "q": ".net ios",
>>  "_": "1434345788751",
>>  "wt": "json"
>>  }
>>  },
>>  "response": {
>>  "numFound": 2,
>>  "start": 0,
>>      "docs": [
>>     {
>>
>>     "KeySkills": "Android, ios, Phonegap, ios",
>>     "_version_": 1504020323727573000,
>>     "score": 0.47567564
>>
>>    },
>>    {
>>
>>     "KeySkills": "net, net, net, MVC, HTML, CSS",
>>     "_version_": 1504020323675144200,
>>     "score": 0.4726259
>>   }
>> ]
>> }
>> }
>>
>>
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Solr5-search-not-displaying-results-based-on-relevancy-tp4211796.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>
>
>
> --
> --------------------------
>
> Benedetti Alessandro
> Visiting card : http://about.me/alessandro_benedetti
>
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
>
> William Blake - Songs of Experience -1794 England

Re: Solr5 search not displaying results based on relevancy

Posted by Alessandro Benedetti <be...@gmail.com>.
I would really suggest you to take a look to the basics of Lucene scoring.
As it's evident you have not a clear idea of how the scoring is working.

http://www.solrtutorial.com/solr-search-relevancy.html ( simple but old)
http://lucene.apache.org/core/5_2_0/core/index.html

After that, take always care about your indexing and querying analysis
chain, because sometimes it's not matter of scoring.

Cheers



2015-06-15 8:49 GMT+01:00 saninfo08 <sa...@gmail.com>:

>  0
> down vote
> favorite
>
>
> I am implementing Solr search, the search order is not displaying on the
> basis of relevancy. Lets say if use the search keywords as .net ios it's
> returning the results based on score. I have a field KeySkills which holds
> the following data
>
> KeySkills:Android, ios, Phonegap, ios
> KeySkills:.net, .net, .net, MVC, HTML, CSS
>
> Here when i search *.net ios* as search keyword *.net, .net, .net, MVC,
> HTML, CSS* should come first in the results and the score should be higher
> because it contains .net 3 times, but i am getting reverse result.
>
> Is there any setting needs to be done in solr config file or in schema.xml
> file to achieve this or how can i sort the results based on max no of
> occurrence of the the text. please help me to solve this.
>
> Following is the result i get
>
> {
> "responseHeader": {
> "status": 0,
> "QTime": 0,
> "params": {
>  "indent": "true",
>  "q": ".net ios",
>  "_": "1434345788751",
>  "wt": "json"
>  }
>  },
>  "response": {
>  "numFound": 2,
>  "start": 0,
>      "docs": [
>     {
>
>     "KeySkills": "Android, ios, Phonegap, ios",
>     "_version_": 1504020323727573000,
>     "score": 0.47567564
>
>    },
>    {
>
>     "KeySkills": "net, net, net, MVC, HTML, CSS",
>     "_version_": 1504020323675144200,
>     "score": 0.4726259
>   }
> ]
> }
> }
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr5-search-not-displaying-results-based-on-relevancy-tp4211796.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
--------------------------

Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England