-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Search: Highlight exact matches improvements #5270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is using the ES Simple String Query -- but it has almost no documentation on how it works. Quoting the search does result in a smaller set of results than not quoting, but I don't fully understand what is happening. |
It seems that search is properly searching for only "custom domains" for example, but once it hits the highlighter, we're getting highlighted results that only contain part of the queried term. |
You can see the results better on site search: https://readthedocs.org/search/?q=%22custom+domains%22&type=file&version=latest&project=docs |
Looks like a known issue: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html
|
@humitos |
The highlight is back, but not sure if we can do much about this. |
From the docs https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-highlighting.html
Didn't test how it looks like, but maybe I'll give it a try later. |
I'll see if I can play around operators and see if there is any improvement, but this again falls to try to parse the query.
We always need to fallback to the original search when there aren't results, this way we guarantee we don't miss anything. The search extension doesn't fallback.
That may be tricky to solve, we could analyze the original query and return the intended text without any operators (but this could result in dropping some original content from the query). And we would need to implement a mini-parser for the single simple query (probably not that hard). |
Nope, using just the |
This doesn't seem to be a problem with the highlight only. If you take a look at the example that I shared before, https://docs.readthedocs.io/en/stable/search.html?q=%22results+not+found+here%22&check_keywords=yes&area=default you will notice that |
@humitos what you are looking there is the default Sphinx search, our search returns zero results for that query. |
Closing in favor of readthedocs/addons#36 |
In #4292 exact match search was implemented, but I'm not sure it is working as expected or at least it could be improved in some ways.
Following this link, we search for
"404 not found"
not
is highlighted alone, which makes me confuseIn this another example, I search for
"results not found here"
Another search for
"custom domains"
?highlight="custom domains"
which makes the JS code to get confused and do not highlight anythingThe text was updated successfully, but these errors were encountered: