solr - Solr5 search not displaying results based on score -


i implementing solr search, search order not displaying on basis of score. lets if use search keywords .net ios it's returning results based on score. have field title holds following data

keyskills:android, ios, phonegap, ios
keyskills:.net, .net, .net, mvc, html, css

here when search .net ios search keyword net, .net, .net, mvc, html, css should come first in results , score should higher because contains .net 3 times, getting reverse result.

is there setting needs done in solr config file or in schema.xml file achieve or how can sort results based on max no of occurrence of the search string. please me solve this.

following result 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   } ] } } 

as can see in lucene's doc, score not estimated number of matching term:

score(q,d) = coord(q,d) · querynorm(q) · ∑( tf(t in d)· idf(t)²·t.getboost()·norm(t,d) )

where tf(t in d) correlates term's frequency, defined number of times term t appears in scored document d.

idf(t) stands inverse document frequency. value correlates inverse of docfreq (the number of documents in term t appears). means rarer terms give higher contribution total score.

coord(q,d) score factor based on how many of query terms found in specified document.

t.getboost() search time boost of term t in query q specified in query text.

norm(t,d) encapsulates few (indexing time) boost , length factors:

  • field boost
  • lengthnorm computed when document added index in accordance number of tokens of field in document, shorter fields contribute more score.

when document added index, above factors multiplied. if document has multiple fields same name, boosts multiplied together:

norm(t,d) = lengthnorm · ∏ f.boost()

so, here guess "keyskills": "android, ios, phonegap, ios" before other document because contains less words other one.

to check that, can use awesome tool, explain.solr.pl.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -