Ticket #284: reader.py

File reader.py, 486 bytes (added by Richard Boulton, 16 years ago)

Re-implementation of reader.pl in python

Line 
1#!/usr/bin/env python
2
3import xapian
4import sys
5
6db = xapian.Database("/tmp/test_index")
7query = xapian.Query(xapian.Query.OP_AND, 'XFOOone', 'XBARtwo')
8
9print "%s every single dot is one query" % query
10while True:
11 db.reopen()
12 enquire = xapian.Enquire(db)
13
14 enquire.set_sort_by_value_then_relevance(1, 0)
15 #enquire.set_weighting_scheme(BoolWeight->new());
16 enquire.set_query(query)
17
18 mset = enquire.get_mset(0, 20)
19
20 sys.stdout.write(".")
21 sys.stdout.flush()