Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A search query parser that works in conjunction with haystack

Project Description

Converts arbitrarily complicated user entered query strings to a haystack query object.

from haystack_queryparser import ParseSQ
Also provides or_parser and and_parser which can be directly used with a query
parser = ParseSQ()
sq_object = parser.parse(query)
takes a `AND` or `OR` operator to use as default optionally.

Input should be a string.This the query.

Output is a `SQ(haystack.query.SQ)` object.
This can be passed to `SearchQuerySet.filter` and the query will be applied

To run the test you need to be in the django environment.So you can do something like this:
$ python shell
>>> import haystack_queryparser.tests as test
>>> tests.main()
test_operators (modules.haystack_queryparser2.tests.SimpleTest) ... ok
test_parse (modules.haystack_queryparser2.tests.SimpleTest) ... ok
test_parse_with_new_default (modules.haystack_queryparser2.tests.SimpleTest) ... ok

Ran 3 tests in 0.004s

Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
haystack_queryparser-0.2.1.tar.gz (3.5 kB) Copy SHA256 Checksum SHA256 Source Feb 28, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting