ASCIIwwdc / asciiwwdc.com

Searchable full-text transcripts of WWDC sessions

Home Page:https://asciiwwdc.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wildcard / Prefix Matching

cocoahero opened this issue · comments

I noticed that the search method appends the ":*" prefix matching operator on to the end of the query, however plainto_tsquery does not support prefix matching.

http://www.postgresql.org/docs/9.3/static/textsearch-controls.html

This can be solved by switching to to_tsquery, but also would require you to manually split the query into tokens separated by AND operators to achieve the same effect as plainto_tsquery.

If PRs are accepted, I would be more than happy to make a patch. =)

Ah, thanks for pointing that out. fb3729b makes the appropriate change.

I had recently played around with manually parsing the query string to, for example, split on camelized words, but I couldn't quite get things working how I would have liked. If you can think of any particularly compelling reason to switch over to to_tsquery, I'd love to see that pull request.

Thanks again for your help, @cocoahero!