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

Is it possible to ignore accents when querying, but use them for ranking? #473

Open
goulvench opened this issue Aug 2, 2021 · 2 comments

Comments

@goulvench
Copy link

Hello, and thanks for this gem, which works great and has both a great API and clear documentation.

Here is a simplified version of the code I'm using to demonstrate what I'm facing:

class User < ApplicationRecord
  include PgSearch::Model
  pg_search_scope :search, against: :name, ignoring: :accents
end

User.upsert_all([{name: 'Elodie', name: 'Élodie'}])
User.search('Élodie').collect(&:name)
=> ['Elodie', 'Élodie'] # results are ranked by id ascending by default, though the second is a better match

How can I boost ranking for results where the search query matches the records without ignoring accents? Is that possible or should I sort the result set manually?

@nertzy
Copy link
Collaborator

nertzy commented Aug 3, 2021

That's an interesting use case that makes sense. I am pretty sure it's not yet supported.

@idrista
Copy link

idrista commented Jan 11, 2024

Did you find a solution, I'm in the same situation?

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

3 participants