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

LIKE / ILIKE search #3

Open
pivotal-casebook opened this issue Jan 19, 2011 · 6 comments
Open

LIKE / ILIKE search #3

pivotal-casebook opened this issue Jan 19, 2011 · 6 comments

Comments

@pivotal-casebook
Copy link

We could make a trivial search that uses SQL LIKE and ILIKE. It ought to be database-agnostic.

@nertzy
Copy link
Collaborator

nertzy commented Dec 21, 2016

This hasn't been important in the last five years so I'll close it.

@nertzy
Copy link
Collaborator

nertzy commented May 16, 2017

Reopening since someone has asked for it in #356

@maxgronlund
Copy link

looking for a way to find users where their email ends with '@example.com'

@nertzy
Copy link
Collaborator

nertzy commented Mar 3, 2019

Without pg_search, you could do with with something like User.where("email ILIKE '%@example.com'")

See https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-LIKE

@3pns
Copy link

3pns commented Jun 15, 2020

Any reason/problem why this has not been integrated in pg_search for the past decade ? Although it is possible to write raw SQL, being able to use LIKE/ILIKE through pg_search would be cleaner.

I'd be happy to work on a pull request if @nertzy will consider it.

@nertzy
Copy link
Collaborator

nertzy commented Jun 22, 2020

I would consider it. There are a lot of moving parts involved with implementing a pg_search feature, such as how they work with each other with weighting, etc., so it might be difficult, but it's definitely worth a shot.

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

4 participants