[Xapian-discuss] Sorting and comparing
flbos at hotmail.com
Mon Sep 12 22:13:22 BST 2005
I've got a few more things that I can't figure out when I look at the
documents. In the documentation the SORT cgi parameter is explained. The
document tells that by default a string comparison is used but I want to
sort on a date. Can I alter the comparison mode somehow? I'd also like to
know if it's possible to specify whether to sort ascending or descending.
I'd like to be able to sort both ways.
Further I'd like to know if I can specify a field name for the date range
restriction I want to add to my search query. I've looked at START END and
SPAN but I don't see how I can use these parameters for a certain field.
When I just pass: START=20050907&END=20050915 search results from before 7
september are not returned (as you would expect) but I can't figure out
which date field is used. The problem here is that I've got more than one
date field specified in my documents in the search db and that I want to
able to restrict my search using each of those date fields (not at the same
time though). I tried this:
STARTdatefieldname=20050907&ENDdatefieldname=20050915 but this doesn't work
so I figure this is not the right way. So can I specify the a date field to
restrict the search or isn't this possible at all (and maybe the insertion
date in the db is used for date restriction?).
Final question: can I use an integer comparison for a certain field? I've
got a field in my search db that can be a number between 0 and 999. Now I'd
like to be able to restrict my search (example) to those documents where
this field has a value between 111 and 379 (and this could be totally
different numbers the next time). Can this be done somehow and what would be
the best way to do so? I'm starting to think that this kind of search
restriction is not really what Xapian/Omega is meant for or am I wrong here?
I thought so because this is neither a text search, nor a boolean search.
I hope someone can help me out once more. By the way, I'm really satisfied
with the performance of Omega/Xapian. On the fly inserting of new records
using script input files works great for me.
More information about the Xapian-discuss