Skip to content
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

Search facets query #2231

Merged
merged 3 commits into from Jul 9, 2019

Conversation

@noirbizarre
Copy link
Member

commented Jul 9, 2019

This query improve (fix in the case of empty q query) facets and topics filtering by using a Bool(must) instead of a Bool(filter) for facets/tags filtering (see https://www.elastic.co/guide/en/elasticsearch/reference/2.4/query-dsl-bool-query.html for reference).

The Bool(filter) form isn't contributing to scoring leading to an unranked list of results when q was omitted.
As a benefic side effect, the Bool(must) form should improve performance as the score functions are only applied on the matching query instead of the whole indexed data (in case of q-less query)

Some examples of result changes on www.data.gouv.fr

All data with France coverage

URL: https://www.data.gouv.fr/fr/datasets/?geozone=country%3Afr

Before After Query (q=France)
screenshot-www data gouv fr-2019 07 09-10-20-57 screenshot-data xps-2019 07 09-10-21-30 screenshot-data xps-2019 07 09-16_12_40

Datasets tagged association

URL: https://www.data.gouv.fr/fr/datasets/?tag=association

Before After Query (q=association)
screenshot-www data gouv fr-2019 07 09-10-26-33 screenshot-data xps-2019 07 09-10-27-11 screenshot-data xps-2019 07 09-16_10_52

Dataset tagged elections

URL: https://www.data.gouv.fr/fr/datasets/?tag=elections

Before After Query (q=elections)
screenshot-www data gouv fr-2019 07 09-10-32-26 screenshot-data xps-2019 07 09-10-33-11 screenshot-data xps-2019 07 09-16_10_01

A Topic

URL: https://www.data.gouv.fr/fr/topics/education-et-recherche/datasets

Before After
screenshot-www data gouv fr-2019 07 09-10-29-03 screenshot-data xps-2019 07 09-10-29-29
@noirbizarre noirbizarre changed the title WIP: Search facets query Search facets query Jul 9, 2019
@noirbizarre noirbizarre requested a review from opendatateam/etalab Jul 9, 2019
@noirbizarre noirbizarre added the bug label Jul 9, 2019
@abulte
abulte approved these changes Jul 9, 2019
Copy link
Member

left a comment

🎉

CHANGELOG.md Outdated Show resolved Hide resolved
@taniki

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

You should provide screenshot of three-way diff : before/after/query as a string instead of a tag

@taniki

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

(The goal is to get relatively consistent results between tag:foo and foo. It should even be more relevant when using a tag than a plain string)

@noirbizarre noirbizarre force-pushed the noirbizarre:search-facets-query branch from 926e46d to 1feaddd Jul 9, 2019
noirbizarre added 3 commits Jul 9, 2019
…tags
@noirbizarre noirbizarre force-pushed the noirbizarre:search-facets-query branch from 1feaddd to bbe1bc2 Jul 9, 2019
@noirbizarre noirbizarre merged commit aca55a3 into opendatateam:master Jul 9, 2019
3 checks passed
3 checks passed
ci/circleci: assets Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: python Your tests passed on CircleCI!
Details
@noirbizarre noirbizarre deleted the noirbizarre:search-facets-query branch Jul 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.