https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23649

--- Comment #40 from Jason Robb <[email protected]> ---
Created attachment 208755
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208755&action=edit
Bug 23649: (QA follow-up) Clarify relevance boost hint text

'The gallows bird' has a very high score (6.7) I believe because the term
'bird' is ~33% of the main title. This record is #1 for an unboosted vanilla
query. Run the following inside ktd with elasticsearch:

curl -s -X POST
"http://es:9200/koha_kohadev_biblios/_search?filter_path=hits.hits._id,hits.hits._score,hits.hits._source.title";
\
  -H 'Content-Type: application/json' \
  -d '{
    "query": { "query_string": { "query": "bird~" } },
    "_source": ["title"]
  }' | python3 -m json.tool

Notice that 'The Computer Bible' scores 3.515.

Now, if we run the same query, but adding the weight of '2.0' if homebranch is
MPL:

curl -s -X POST
"http://es:9200/koha_kohadev_biblios/_search?filter_path=hits.hits._id,hits.hits._score,hits.hits._source.title";
\
  -H 'Content-Type: application/json' \
  -d '{
    "query": {
      "function_score": {
        "query": { "query_string": { "query": "bird~" } },
        "functions": [ { "filter": { "term": { "homebranch__facet": "MPL" } },
"weight": 2 } ],
        "boost_mode": "multiply"
      }
    },
    "_source": ["title"]
  }' | python3 -m json.tool

You will notice the following:
- 'The gallows bird' keeps its 6.7 score as before.
- 'The Computer Bible' now scores 7.03 because of the '2.0' boost multiplier.
- Even if 'MPL' records have had their score boosted, 'The gallows bird' is
still ranked #2 because it scored very high even without the boost.

Signed-off-by: Jason Robb <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to