Change "exact match boost" implementation to use a match_phrase
query in should
#4960
Labels
💻 aspect: code
Concerns the software code in the repository
✨ goal: improvement
Improvement to an existing user-facing feature
🟩 priority: low
Low priority and doesn't need to be rushed
🧱 stack: api
Related to the Django API
🔧 tech: elasticsearch
Involves Elasticsearch
🐍 tech: python
Involves Python
Problem
We currently use an additional simple query string entry into the boolean filter for search to boost exact phrasal matches on the title of a work:
openverse/api/api/controllers/search_controller.py
Lines 305 to 312 in 50e401f
Description
We can bypass simple query string altogether for this, saving some parsing cycles in Elasticsearch, and making our intention much clearer in code (and in the generated query), by using
match_phrase
directly. This also obviates the need to mock out the simple-query-string syntax for phrasal matches.The text was updated successfully, but these errors were encountered: