A query parser for haystack

218 views
Skip to first unread message

Vignesh Sarma

unread,
May 10, 2012, 5:00:15 AM5/10/12
to django-...@googlegroups.com
Hi,

we have created a Search query parser, that can be used with haystack, it returns a SQ object,

for more details look at: https://github.com/recruiterbox/haystack-queryparser#readme

feel free to use it,


-vignesh
Thanks

Matt DeBoard

unread,
May 10, 2012, 6:50:27 PM5/10/12
to django-...@googlegroups.com
What bits of it aren't in the "mostly working" category? 

Vignesh Sarma

unread,
May 11, 2012, 12:33:52 AM5/11/12
to django-...@googlegroups.com
Hi,

Every thing is now working, we were testing it on recruiterbox.com. Its completely working now.

--
You received this message because you are subscribed to the Google Groups "django-haystack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-haystack/-/oz1_2F0AIU4J.
To post to this group, send email to django-...@googlegroups.com.
To unsubscribe from this group, send email to django-haysta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-haystack?hl=en.

Danny Adair

unread,
May 11, 2012, 3:51:18 AM5/11/12
to django-...@googlegroups.com
On Thu, May 10, 2012 at 9:00 PM, Vignesh Sarma <vig...@recruiterbox.com> wrote:
>[...]
Thanks for sharing Vignesh!

P.S.: "from haystack.query import SearchQuerySet" in getSQ.py is an
unused import
Your "__name__=='__main__'" block - if needed at all - should start with
sq = parse(raw_input("Enter: "))
otherwise "sq" is not defined

Cheers,
Danny

Matt DeBoard

unread,
May 11, 2012, 6:50:14 AM5/11/12
to django-...@googlegroups.com
Cool, I will definitely be putting this into production soon.

Vignesh Sarma

unread,
May 11, 2012, 7:57:32 AM5/11/12
to django-...@googlegroups.com
Thanks for pointing out, updated.

--
You received this message because you are subscribed to the Google Groups "django-haystack" group.

Vignesh Sarma

unread,
May 11, 2012, 7:59:00 AM5/11/12
to django-...@googlegroups.com
That sounds awesome!!!

Mario Menezes

unread,
Jun 12, 2012, 8:07:04 AM6/12/12
to django-...@googlegroups.com
Hi,

    Should it possible to give me a little help on how to use the query parser?

    I've haystack + xapian installed and working with facets but the AutoQuery is doing a poor job with the simplest query string with 2+ words, so I really need query parser. What I mean is, with one word query, the results are coming back; but if I try a two words query nothing shows up even though both words are indexed. That is, AutoQuery isn't splitting the words properly.
 
    An example of the search method should be enough or any other help on how to stack query parser with haystack.

    Thanks in advance.

Mário


Em sexta-feira, 11 de maio de 2012 08h59min00s UTC-3, Vignesh Sarma escreveu:
That sounds awesome!!!

On Fri, May 11, 2012 at 4:20 PM, Matt DeBoard wrote:
Cool, I will definitely be putting this into production soon.
On Fri, May 11, 2012 at 12:33 AM, Vignesh Sarma  wrote:
Hi,

Every thing is now working, we were testing it on recruiterbox.com. Its completely working now.


On Fri, May 11, 2012 at 4:20 AM, Matt DeBoard  wrote:
What bits of it aren't in the "mostly working" category? 

On Thursday, May 10, 2012 5:00:15 AM UTC-4, Vignesh Sarma wrote:
Hi,

we have created a Search query parser, that can be used with haystack, it returns a SQ object,

for more details look at: https://github.com/recruiterbox/haystack-queryparser#readme

feel free to use it,


-vignesh
Thanks

--


--

--


Vignesh Sarma

unread,
Jun 12, 2012, 8:56:54 AM6/12/12
to django-...@googlegroups.com
Hi Mario,

We needed some thing of the sort and we created this,

you can just pass the query into the parse function, and you will get an SQ object in return, which can be used to do the actual filter in haystack.

As an alternative you might want to checkout this script also...



--
You received this message because you are subscribed to the Google Groups "django-haystack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-haystack/-/wep8oX_R1vcJ.

vignesh

unread,
Jun 12, 2012, 9:08:44 AM6/12/12
to django-...@googlegroups.com
Hi Mário,

here is some sample code,

import haystack_queryparser
try:
haystack_understandable_q = haystack_queryparser.parse(search_term) #search_term is your user inserted query.
qset = SearchQuerySet().filter(haystack_understandable_q)

except haystack_queryparser.NoMatchingBracketsFound:pass
#do some thing 
except haystack_queryparser.UnhandledException:pass
#do some thing


On Tue, Jun 12, 2012 at 5:37 PM, Mario Menezes <mo.me...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "django-haystack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-haystack/-/wep8oX_R1vcJ.
Reply all
Reply to author
Forward
0 new messages