[Xapian-discuss] Value field Query and case sensitivity

Olly Betts olly at survex.com
Thu Apr 10 13:57:46 BST 2008


On Thu, Apr 10, 2008 at 12:14:52PM +0100, Colin Bell wrote:
> I think this solves it. I'll try it out today.
> 
>  From http://xapian.org/docs/valueranges.html
> Custom subclasses
> 
> You can easily create your own subclasses of  
> Xapian::ValueRangeProcessor. Your subclass needs to implement a method  
> Xapian::valuenooperator()(std::string &begin, std::string &end) so for  
> example you could implement a better version of the author range  
> described above which only matches ranges with a prefix (e.g.  
> author:asimov..bradbury) and lower-cases the names:

No, this allows you to process ranges in user query strings, so it can
do the "lower casing the value to filter on at search time" bit.  The
comparison is *always* just a string comparison, comparing the raw byte
values.

As James says, store the string you want to show users in the document
data, and store the string you want to sort, filter, or collapse on in
a value.  Document values aren't meant to be used as general purpose
fields.

Cheers,
    Olly



More information about the Xapian-discuss mailing list