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

feat: set stemmer to minimal #12

Merged
merged 1 commit into from
Nov 18, 2024
Merged

feat: set stemmer to minimal #12

merged 1 commit into from
Nov 18, 2024

Conversation

f-necas
Copy link

@f-necas f-necas commented Nov 15, 2024

Upstream PR: geonetwork/core-geonetwork#8500


It solves issues with elasticsearch requests.

Stemmer (as I understand) is used to optimize word computation when requests are excuted. Words with the same roots are then reduced to their root "version". So, words like "continua", "continuait" are reduced to "continu".

The lightest the stemmer is, the closest it is to a dictionnary stemmer (all words, with all declinaisons...) but it's also slower.

For a record with French word "Etablissements", some requests didn't work. It works for all languagues and default but not French.

I've set record with the same translation "Etablissements de Cleaux" for different lang and tried those ES requests :

{
  "query": {
    "bool" : {
      "should": [
        { "prefix": { "resourceTitleObject.langfre": "etabliss"}}
      ]
    }
  },
  "_source": [
    "resourceTitleObject"
  ],
  "from": 0,
  "size": 20
}

OR

{
  "query": {
    "match_phrase_prefix" : {
      "resourceTitleObject.langfre": {
         "query": "etabliss"
      }
    }
  },
  "_source": [
    "resourceTitleObject"
  ],
  "from": 0,
  "size": 20
}

@fvanderbiest
Copy link
Member

Can you provide a bit of context in the ticket description ?
Why do we do this ? What are the expected benefits ? What are the implications ?
This will greatly improve the reviewer's experience.
Thanks :-)

@f-necas f-necas requested a review from fvanderbiest November 18, 2024 14:36
@fvanderbiest
Copy link
Member

We indeed observed issues with the datahub's gn-ui-autocomplete component which produced irrelevant results while typing "etablisse", "etablissem", "etablisseme", "etablissemen", and finallly produced relevant results with the final t on "etablissement". This can be witnessed on https://www.geo2france.fr/datahub/

@f-necas f-necas merged commit 9e66b48 into gn4.2.7 Nov 18, 2024
@fvanderbiest fvanderbiest deleted the minimal-french-stemmer branch November 19, 2024 07:56
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.

2 participants