That issue seems to happen only with elasticsearch 6. So make this BZ depends on ES 6 Omnibus. Refining a search on author lead to the following query: "query_string": { "query": "(_record:*) AND author:Dillinger Girl" } This query returns a document with "Dillinger Escaplan" as author and "Girl" in the title => Ko The fix should be something like: "query_string": { "query": "(_record:*) AND author:(Dillinger Girl)" } That query returns only documents with "Dillinger Girl" as author => Ok
Created attachment 92498 [details] [review] Bug 23521: Put parentheses arround limit terms Test plan: - Use Elasticsearch 6 (you'll need Bug 18969), - create a biblio (#1) with "Dillinger Girl" in author and what you want in title, - create another biblio (#2) with the word "girl" in the title and "Dillinger Escaplan" as author - reindex - search * and refine on "Dillinger Girl" - Ko => Biblio #1 and #2 appear - Apply this patch, - search * and refine on "Dillinger Girl" - Ok => anly biblio #1 appears - use Elasticsearch 5 again - check for no search regression
See doc : https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-query-string-query.html
(In reply to Fridolin SOMERS from comment #2) > See doc : > > https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-query- > string-query.html You see an example of query containing parenthesis ofr terms with many words
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 93741 [details] [review] Bug 23521: Put parentheses arround limit terms Test plan: - Use Elasticsearch 6 (you'll need Bug 18969), - create a biblio (#1) with "Dillinger Girl" in author and what you want in title, - create another biblio (#2) with the word "girl" in the title and "Dillinger Escaplan" as author - reindex - search * and refine on "Dillinger Girl" - Ko => Biblio #1 and #2 appear - Apply this patch, - search * and refine on "Dillinger Girl" - Ok => anly biblio #1 appears - use Elasticsearch 5 again - check for no search regression Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 94771 [details] [review] Bug 23521: Put parentheses arround limit terms Test plan: - Use Elasticsearch 6 (you'll need Bug 18969), - create a biblio (#1) with "Dillinger Girl" in author and what you want in title, - create another biblio (#2) with the word "girl" in the title and "Dillinger Escaplan" as author - reindex - search * and refine on "Dillinger Girl" - Ko => Biblio #1 and #2 appear - Apply this patch, - search * and refine on "Dillinger Girl" - Ok => anly biblio #1 appears - use Elasticsearch 5 again - check for no search regression Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 94772 [details] [review] Bug 23521: (follow-up) Add quotes Not only should terms from facets/limits be grouped, but order should probably matter We build a different facet for "Dillinger Girl" or "Girl Dillinger" The parens are possibly overkill now, but I think it makes it very clear and does not hurt To test: 1 - Follow original plan 2 - Create a new record with 'Girl Dillinger' as author 3 - Search for 'Dill*' 4 - You get all three records (and maybe others that match) 5 - Limit by 'Girl Dillinger' - you get two records 6 - Same for 'Dillinger Girl' 7 - Apply patch 8 - Limits/facets for 'Dillinger Girl' and 'Girl Dillinger' now match a isngle record
Alex, your patches work well, but I took things a bit further, can you check my work? Added Ere to CC for another opinion.
Created attachment 94799 [details] [review] Bug 23521: Put parentheses arround limit terms Test plan: - Use Elasticsearch 6 (you'll need Bug 18969), - create a biblio (#1) with "Dillinger Girl" in author and what you want in title, - create another biblio (#2) with the word "girl" in the title and "Dillinger Escaplan" as author - reindex - search * and refine on "Dillinger Girl" - Ko => Biblio #1 and #2 appear - Apply this patch, - search * and refine on "Dillinger Girl" - Ok => anly biblio #1 appears - use Elasticsearch 5 again - check for no search regression Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Created attachment 94800 [details] [review] Bug 23521: (follow-up) Add quotes Not only should terms from facets/limits be grouped, but order should probably matter We build a different facet for "Dillinger Girl" or "Girl Dillinger" The parens are possibly overkill now, but I think it makes it very clear and does not hurt To test: 1 - Follow original plan 2 - Create a new record with 'Girl Dillinger' as author 3 - Search for 'Dill*' 4 - You get all three records (and maybe others that match) 5 - Limit by 'Girl Dillinger' - you get two records 6 - Same for 'Dillinger Girl' 7 - Apply patch 8 - Limits/facets for 'Dillinger Girl' and 'Girl Dillinger' now match a isngle record Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Makes sense to me. I don't particularly like the slightly ambiguous syntax used with limits (I'd interpret 'author:Something Other' as 'author:(Something) AND Other', but since it works with Zebra, we need to support that. A helper function for splitting a string to field and term would be nice since we do the same regexp now in at least two places, but it's still clear enough that it works for me.
With comments (and subsequent signoffs) from all ES experts already I'm going to go for PQA on this one.
Nice work everyone! Pushed to master for 20.05
Backported to 19.11.x branch for 19.11.05
missing dependencies for 19.05.x, not backporting