geovistory / design-system

MIT License
2 stars 1 forks source link

Improve fulltext search in entity explorer #43

Closed joschne closed 1 year ago

joschne commented 1 year ago

Problem

Search in geovistory.org for Girard Grégoire. -> no result

And search in geovistory.org for Grégoire Girard. -> finds one person

Desired behavior

Search for Girard Grégoire should find the same person as search for Grégoire Girard.

Solution

The code responsible for the search is here:

https://github.com/geovistory/design-system/blob/8485763e93754f4de8cf0fbe0a23015c9f5a9f39/packages/design-system-web/src/components/geov-explorer/lib/getTextFilter.tsx#L6

The getTextFilter() function is called from different places.

The text filter generated by the function is using Lucene syntax included in SPARQL, as described here:

Change the filter string to be match the desired behavior.

perrauda commented 1 year ago

Gaetan suggests that searching with unaccented letters (e instead of é for example...) can still find the right words like Gregoire for Grégoire.