[Xapian-devel] setting ValueRangeProcessor at runtime

Peter Karman peter at peknet.com
Mon Nov 16 03:53:02 GMT 2009

Olly Betts wrote on 11/15/09 7:50 PM:
> On Sat, Nov 14, 2009 at 09:32:20PM -0600, Peter Karman wrote:

>> What's the correct way to dynamically add a series of ValueRangeProcessors?
> In C++ you dynamically allocate with new:
>     Xapian::StringValueRangeProcessor * sproc;
>     sproc = new Xapian::StringValueRangeProcessor(vp++);
>     qparser.add_valuerangeprocessor(sproc);
> To avoid leaking them (which isn't really a problem if this is a short lived
> process like a CGI script, but would be for a query server), stick them into
> a vector or similar and delete them later

brilliant. thanks for the very clear examples and explanation, Olly.

Peter Karman  .  http://peknet.com/  .  peter at peknet.com

More information about the Xapian-devel mailing list