[Xapian-discuss] Python segmentation fault when abstracting value range processor
Simon Roe
simon.roe at talusdesign.co.uk
Wed Mar 4 10:56:17 GMT 2009
On Wed, Mar 4, 2009 at 10:52 AM, James Aylett <james-xapian at tartarus.org> wrote:
> On Wed, Mar 04, 2009 at 10:39:28AM +0000, Simon Roe wrote:
>
>> Running the attached code[...]
>
> This was missing!
Odd, I did attach it. I guess as it's a python script it got removed
by some virus checker.
Here it is, pasted in:
=======================================
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import xapian
def load_queryparser():
q = xapian.QueryParser()
q.set_default_op(xapian.Query.OP_AND)
vrp = xapian.NumberValueRangeProcessor(1,'year:')
q.add_valuerangeprocessor(vrp)
return q
if __name__ == '__main__':
qp = load_queryparser()
# This works fine
# qp = xapian.QueryParser()
# qp.set_default_op(xapian.Query.OP_AND)
#
# vrp = xapian.NumberValueRangeProcessor(1,'year:')
# qp.add_valuerangeprocessor(vrp)
query_string = "john year:1..2"
query = qp.parse_query(query_string)
print "Parsed query is: %s" % query.get_description()
=======================================
--
Help save the economy:
http://seriouschange.org.uk/
E: simon.roe at talusdesign.co.uk
M: 07742079314
More information about the Xapian-discuss
mailing list