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

Possibility to have by default the search url Accent Unsensitive #70

Open
jefBinomed opened this issue Dec 8, 2017 · 6 comments
Open
Projects

Comments

@jefBinomed
Copy link

When we have a request like https://{myDomain}/api/v3/myRessource?name=like,{key}.... It would nice if by default the like search is not sensitive to accent

@nfaugout-lucca
Copy link
Contributor

In Nextends, there is a methode RemoveDiacritics( ) that correspond to this need.

https://github.com/LuccaSA/NExtends/blob/master/NExtends/Primitives/Strings/String.extensions.cs#L106

@rducom do you know how to translate this in SQL ?!

Or we simply should invite people to change their collation in SQL in order to match row with accent insentive search ?

@rducom
Copy link
Contributor

rducom commented Dec 8, 2017

Many things here :

  • A http specific query is IMO not a good idea. Driving the CA CI option should be implemented in backend, and not be exposed via URL specific params
  • Changing collation is the easy way. (there's no SQL equivalent of RemoveDiacritics which is indexed). BUT it's IMO a "bad design" to rely on such specific SQL feature.
  • A better way would be to use SQL Full-text for such specific seraches.
  • In RDD we could provide a "specific base repository" which expose a Search method for such FullText serach

@nfaugout-lucca
Copy link
Contributor

If one just need CI/AI search, why would collation not be the preferred choice ?

NB : If we change the way LIKE works in RDD, we are not going to provide an "option", we would then change the behaviour of LIKE as a whole.

@rducom
Copy link
Contributor

rducom commented Dec 8, 2017

Changing collation is a "hard written" way to have such a feature. It implies more than just the serah, but also impact indexes, FK, and unicity checks... It's "too much" for juste this feature.
Using sql fulltext we can control the behavior for each search.

@nfaugout-lucca
Copy link
Contributor

OK I see.

I found on stack overflow this thread, were someone suggest to make the search with a specific collation.

This way, you do not have to change the collation of the column AND you can perform accent sensitive OR accent insensitive search on demand.

Isn't it a good and cheap alternative to implementing fulltext search in SQL, which seems to be overkill for the need here ?

see https://stackoverflow.com/questions/6357351/ignoring-accents-while-searching-the-database-using-entity-framework, third answer.

@rducom
Copy link
Contributor

rducom commented Dec 8, 2017

Third answer is a collation transformation, which scans the whole table (so no index on it).
The only ways to have both performance and CA/CI feature on string search is either fulltext, or either elastic search

@rducom rducom added this to Needs triage in Bug triage Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Bug triage
  
Needs triage
Development

No branches or pull requests

3 participants