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

Full text search with $q=foo #1

Open
timwis opened this issue Jul 31, 2015 · 2 comments
Open

Full text search with $q=foo #1

timwis opened this issue Jul 31, 2015 · 2 comments

Comments

@timwis
Copy link
Owner

timwis commented Jul 31, 2015

I'm assuming the way to perform a free text search in standard SQL is using the function FREETEXT(). node-sqlparser does parse FREETEXT(foo, 'bar') but it does not parse FREETEXT(*, 'bar') (with the wildcard) which would be needed to support $q unless we knew the data model and could list each field.

@timothyclemansinsea
Copy link
Contributor

The only references I'm finding for FREETEXT are for Microsoft SQL server. Since I'm interested in this parser for CartoDB I looked for full text search for Postgres and found http://www.postgresql.org/docs/9.1/static/textsearch-intro.html See http://stackoverflow.com/questions/36390439/full-text-search-with-postgres which has my failed attempt at this

@timothyclemansinsea
Copy link
Contributor

select * FROM seattle_police_govqa_audit_trails as r WHERE regexp_replace(array_to_string(translate(string_to_array(r::text, ',')::text, '()', '')::text[], ' '), '[^a-zA-Z\s]', ' ', 'g')::tsvector @@ 'Dear & picked'::tsquery = true LIMIT 10

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

2 participants