Ticket #284: reader.py
File reader.py, 486 bytes (added by , 16 years ago) |
---|
Line | |
---|---|
1 | #!/usr/bin/env python |
2 | |
3 | import xapian |
4 | import sys |
5 | |
6 | db = xapian.Database("/tmp/test_index") |
7 | query = xapian.Query(xapian.Query.OP_AND, 'XFOOone', 'XBARtwo') |
8 | |
9 | print "%s every single dot is one query" % query |
10 | while 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() |