Open-CSP / WikiSearchFront

Front-end for the WikiSearch extension.
GNU General Public License v2.0
3 stars 6 forks source link

Implement fuzzy search ? #6

Open bertrandgorge opened 1 year ago

bertrandgorge commented 1 year ago

See https://github.com/Open-CSP/WikiSearch/pull/26 ? Not sure how to enable it on WikiSearchFront...

robis24 commented 1 year ago

The fuzzy-search commit is only for search filters, the search boxes you can add as a filter on the left. The main search input uses query_string we send a modified version of what is typed there to ElasticSearch, this allows for using special operators like AND OR and more in your search. But not everybody needs those operators.

I discussed with @marijnvanwezel to add an option top switch between simple_query_string and query_string in the near future. Suggestion and you thoughts are more than welcome.

When setting the debug option for WikiSearch you can see the final ElasticSearch query that is send to ElasticSearch in your network tab.

robis24 commented 1 year ago

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-fuzziness

bertrandgorge commented 1 year ago

Hello, here is a proposed solution. I saw from some testing that simple_query_string will not change much, but the simplest is yet to add the ~ to the words when no other special search items are present. There's already some code that does that (which adds *), so I guess the best is to opt for fuzziness ?

I guess the way I grabbed the option from the config settings is not particularly neat, I didn't know how to do better...!