[Xapian-discuss] How to search documents with certain values

Abhinay Mehta abhinay.mehta at gmail.com
Tue Jun 1 15:17:43 BST 2010


Thanks Olly, I'm using the filter you suggested first time round and it's
all working nicely.

On 1 June 2010 15:14, Olly Betts <olly at survex.com> wrote:

> On Mon, May 24, 2010 at 10:06:17AM +0100, Abhinay Mehta wrote:
> > I've tested it and can use Xapian::DateValueRangeProcessor by appending
> the
> > range string: YYYYMMDD..YYYYMMDD to the user query myself.
> > Not sure if that's too much of a cow-boy way of doing it.
>
> That's a bad idea - don't try to adjust the user's query string, instead
> apply a filter afterwards.  I even gave you the code in my earlier reply:
>
> > > In C++, augment your query like so:
> > >
> > >    Xapian::Query filter(Xapian::Query::OP_VALUE_GE, threshold_value);
> > >    query = Xapian::Query(Xapian::Query::OP_FILTER, query, filter);
>
> > Also would anyone know about the performance difference between the two
> > different methods?
>
> The same, but applying the filter as I suggest doesn't risk tripping up the
> query parser.
>
> Cheers,
>     Olly
>


More information about the Xapian-discuss mailing list