From a4281e7cbd4209c729fa717fd344f87206390c45 Mon Sep 17 00:00:00 2001 From: David Sauve Date: Mon, 28 May 2012 16:06:07 -0700 Subject: [PATCH] Updated narrow_queries in backend search to AND queries rather than OR. Thanks to naktinis for the original patch. --- AUTHORS | 5 +---- setup.py | 6 +++--- xapian_backend.py | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/AUTHORS b/AUTHORS index fe1ba51..0dd3a99 100644 --- a/AUTHORS +++ b/AUTHORS @@ -26,9 +26,6 @@ Thanks to: * glassresistor for assistance troubleshooting an issue with boosting a phrase query & a patch to make weighting schemes overridable. * James Addison for helping to debug an intermittent issue with `order_by` and `build_schema`. * Michael Opitz for a patch that enables support for `inmemorydb`. -<<<<<<< HEAD * Evgeniy Kirov for a patch that adds `HAYSTACK_XAPIAN_LANGUAGE` used for setting the stemming language. * domasx2 for a patch that explicitly closes the database when not in use. -======= - * Evgeniy Kirov for a patch that adds `HAYSTACK_XAPIAN_LANGUAGE` used for setting the stemming language. ->>>>>>> fb4929854070f88e40896799a09c0781a3d3d562 + * naktinis for a patch that fixed changes the behaviour of the `narrow_queries` argument of `search` so that queries are ANDed together rather than ORed. diff --git a/setup.py b/setup.py index d9f2270..533d902 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ def read(fname): setup( name='xapian-haystack', - version='1.1.5beta', + version='2.0.0', description="A Xapian backend for Haystack", long_description=read('README.rst'), classifiers=[ @@ -17,8 +17,8 @@ setup( 'Framework :: Django', ], author='David Sauve', - author_email='dsauve@trapeze.com', + author_email='david.sauve@bag-of-holding.com', url='http://github.com/notanumber/xapian-haystack', - license='GPL3', + license='GPL2', py_modules=['xapian_backend'], ) diff --git a/xapian_backend.py b/xapian_backend.py index 65a0e08..a6801a6 100755 --- a/xapian_backend.py +++ b/xapian_backend.py @@ -2,7 +2,7 @@ # Copyright (C) 2009, 2010 Trapeze __author__ = 'David Sauve' -__version__ = (2, 0, 0, 'beta') +__version__ = (2, 0, 0) import time import datetime @@ -384,7 +384,7 @@ class XapianSearchBackend(BaseSearchBackend): if narrow_queries is not None: query = xapian.Query( xapian.Query.OP_AND, query, xapian.Query( - xapian.Query.OP_OR, [self.parse_query(narrow_query) for narrow_query in narrow_queries] + xapian.Query.OP_AND, [self.parse_query(narrow_query) for narrow_query in narrow_queries] ) )