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

project search exclude #43

Closed
glensc opened this issue Nov 25, 2014 · 10 comments
Closed

project search exclude #43

glensc opened this issue Nov 25, 2014 · 10 comments

Comments

@glensc
Copy link
Contributor

glensc commented Nov 25, 2014

wanted to search for "ruby" package (the ruby language), the pattern was modified to be "ruby*"
and they gave me 11 pages of rubygems, tried exclude with minus, that gave nothing:

https://release-monitoring.org/projects/search/?pattern=ruby*+-rubygems

please implement some advanced filtering or exact match

@pypingou
Copy link
Member

Ok I have two approached possible for this ticket:

@ralphbean
Copy link
Contributor

This might prove to be an interesting third option: http://www.postgresql.org/docs/8.3/static/textsearch-intro.html#TEXTSEARCH-MATCHING

@pypingou
Copy link
Member

Well, isn't the question here about being able to do exact match search rather than text search?

@ralphbean
Copy link
Contributor

Yes. But textsearch might be a more flexible method for specifying searches (and it might return results in a nicer order).

@pypingou
Copy link
Member

Ever played with textsearch? In sqlalchemy?

There seems to be some support: http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#full-text-search

@pypingou
Copy link
Member

So I guess there are two issues here:

  • improve the search by using textsearch (table.c.column.match(pattern) in sqlalchemy)
  • allow perfect match search

@pypingou
Copy link
Member

I just did some testing of using match vs ilike when doing the search:

- Packages.package_name.match('python')
- Project.name.match('python')
  -> 451 projects found

- Packages.package_name.ilike('python%')
- Project.name.ilike('python%')
  -> 454 projects found

- Packages.package_name.ilike('python')
- Project.name.ilike('python')
  -> 454 projects found

@ralphbean
Copy link
Contributor

What is the first result? is it 'python'? :)

@pypingou
Copy link
Member

In both case it's not (after removing the order_by constraint)

@ralphbean
Copy link
Contributor

Bummer. I was hoping textsearch would provide the "best" match first like xapian does.

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