[Xapian-discuss] creating index for document values

mark markkicks at gmail.com
Sat Aug 16 17:08:20 BST 2008


i want to query a database and sort the results by a value ( which i
created like this doc.add_value(1, some_value)).
the default search is really fast, but now if i try to sort the
results by this value, it takes over 5 seconds on database with around
2 million documents.
is there anyway i can speed up this? do i need to create an index on
the database on this value to make it fast?
thanks a lot!





python code that i used to search and sort by value 1
import xapian
query_string = 'searching for this'
database = xapian.Database('test')
enquire = xapian.Enquire(database)
qp = xapian.QueryParser()
stemmer = xapian.Stem("english")
qp.set_stemmer(stemmer)
qp.set_database(database)
qp.set_stemming_strategy(xapian.QueryParser.STEM_SOME)
query = qp.parse_query(query_string)
enquire.set_sort_by_value(1)
matches=enquire.get_mset(0,20)



More information about the Xapian-discuss mailing list