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

Fuzzy search with trigram #55

Open
dpakprajul opened this issue May 29, 2024 · 1 comment
Open

Fuzzy search with trigram #55

dpakprajul opened this issue May 29, 2024 · 1 comment
Assignees

Comments

@dpakprajul
Copy link
Collaborator

Issue copied from:
mrmap-community#55

For the fuzzy search, there are some algorithm like levenshtein, soundex, word_similarity and so on.

https://www.postgresql.org/docs/current/fuzzystrmatch.html
https://www.postgresql.org/docs/current/pgtrgm.html

In the mapbender/http/classes/class_metadata.php in line 1284, the code could be change from:
$whereStr .= "searchtext LIKE $" . ($i + 1);
to
$whereStr .= "(strict_word_similarity($" . ($i + 1) . ", searchtext) > 0.2)";

In order to use strict_word_similarity( ) function, we need to install in the postgres first.
CREATE EXTENSION pg_trgm;

Work still need to be done: Check the performance of the search, since a new algorithm is used instead of LIKE.

dpakprajul added a commit that referenced this issue May 29, 2024
…nction, git status! Need to create/install: CREATE EXTENSION pg_trgm; git status! in postgres for its functioning. mrmap-community#55
@dpakprajul dpakprajul self-assigned this May 29, 2024
@dpakprajul
Copy link
Collaborator Author

I think its better to close this issue as it won't go further and has no future. Okay?

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

No branches or pull requests

1 participant