Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Search is too rigid: allow accent-insensitive search queries #115

Closed
JaimeObregon opened this issue Apr 23, 2016 · 2 comments · May be fixed by #545
Closed

Search is too rigid: allow accent-insensitive search queries #115

JaimeObregon opened this issue Apr 23, 2016 · 2 comments · May be fixed by #545

Comments

@JaimeObregon
Copy link
Contributor

We are all used to "google-like" search, where accents and even typos in the query string do not really affect the search results. However Paperless seems to be a little bit too rigid when it comes to search. For instance, Zürich or Telefónica doesn't match Zurich and Telefonica, a behaviour which can frustrate some searches.

It looks like this can be achieved with the current SQLite backend by providing some conversion tables that I guess they are so common that they already exist in the open source community. And after a quick look at Stack Overflow I found some insight which I hope they help.

@danielquinn
Copy link
Collaborator

My own searching for a solution rendered a similar result. Basically, the "simplest" method to work around this problem appears to be to store an ascii-only version of the text in the database parallel to a proper version and then perform searches against that (while also normalising the search query).

Interestingly, this might be a kill-two-birds-with-one-stone situation. #88 involves rewriting all of the stored records and keeping the white space for readability. This might be a good time to write that migration if it means simultaneously creating a "search-only" field for data as well.

I'm going to tag this as enhancement and get to it when I can. Currently, I'm fiddling with doing a better UI, which will help out a lot, because sanitising a search query through Django's admin is likely to be a lot harder than simply handling my own form data on the new front-end.

@danielquinn
Copy link
Collaborator

I just discovered .casefold() which may help in this area.

jonaswinkler pushed a commit to Skylinar/paperless that referenced this issue Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants