Skip to content

ported to elasticsearch 5#61

Merged
orangejulius merged 3 commits intopelias:masterfrom
tecnogeows:elasticsearch5
Apr 12, 2017
Merged

ported to elasticsearch 5#61
orangejulius merged 3 commits intopelias:masterfrom
tecnogeows:elasticsearch5

Conversation

@josendf
Copy link
Contributor

@josendf josendf commented Apr 7, 2017

Hi,

We have ported the queries to ElasticSearch 5, we submit this pull request in case it can be of help.

The following has been performed:

  • The filtered queries were replaced by bool queries, as explained in
    Upgrade & Get Started > Filtered query

  • Empty filter clauses were removed as they affect performance (tested on ElasticSearch 5.3).

  • Upgraded the affected tests.

Regards,

@orangejulius
Copy link
Member

Hey @josendf,
This is amazing, thank you! The only thing I think you missed was the example Elasticsearch queries in the README. Would you mind updating those too? Then we can merge this!

@josendf
Copy link
Contributor Author

josendf commented Apr 12, 2017

Thank you Julian, we have updated the README.

@orangejulius
Copy link
Member

Hey @josendf, thanks! I also saw you made another commit that looks like it changes the functionality of the code. Can you explain why that one's needed?

@josendf
Copy link
Contributor Author

josendf commented Apr 12, 2017

Hi Julian, when updating the examples I've noticed that the focus view function requires to pass a subview, seems that the examples were outdated.

@orangejulius
Copy link
Member

Oh! I didn't even realize it was in an example file. That's great, thanks for noticing!

@orangejulius orangejulius merged commit 04af8eb into pelias:master Apr 12, 2017
orangejulius added a commit that referenced this pull request Jul 5, 2017
A while back #61 changed all our
queries to use Elasticsearch 5 compatible [bool queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html)
instead of the `filtered` queries that were deprecated in Elasticsearch
2, and no longer supported in Elasticsearch 5.

However, while the queries were supposed to behave identically, it
appears that a `filtered` query effectively had a `minimum_should_match`
setting of 1 implied, while the new queries have a
`minimum_should_match` of 0 implied.

This was causing the new queries to return a bunch of irrelevant
results, since any results that match the parent hierarchy filters would
be returned, even if it did not match any of the should conditions.

Our query logic depended on `minimum_should_match` being set to 1, so it's
now explicitly set.

Connects pelias/pelias#461
Connects pelias/api#762
Connects pelias/api#855
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants