i want to add values (For ex pricing, number_comments etc) to the document. can you explain what 0 is here? and what is price? Xapian::Document doc; doc.add_value(0, Xapian::sortable_serialise(price)); when I am searching, how do i specify these sorting properties? thanks a lot!!!
Matteo Zandi
2008-Aug-16 08:35 UTC
[Xapian-discuss] indexing and sorting by value in python
On Sat, Aug 16, 2008 at 4:51 AM, mark <markkicks at gmail.com> wrote:> doc.add_value(0, Xapian::sortable_serialise(price));I have documents in different languages, what I do is: doc.add_value(0, lang) where lang is either 'it' or 'en'.> when I am searching, how do i specify these sorting properties? >then I AND two queries query1 = query = xapian.Query(query_string) query2 = xapian.Query(xapian.Query.OP_VALUE_RANGE, 0, lang, lang) query = xapian.Query(xapian.Query.OP_AND, query1, query2) where query1 is the query entered by the user and query2 is a query which returns only documents which belong to the 'lang' language. The only inconvenience I find in this approach is that you have to remember that 0 is the language, 1 is something else, etc.. Matteo