[Xapian-discuss] Changing order policy

The Craic Finder findingthecraic at gmail.com
Tue Apr 12 12:11:52 BST 2011


Hello Olly and everybody,

thank you very much for your reply, excuse me for my delay replying you.

I think we are talking about the same, the thing is changing the order
policy, in order to put all strange characters (like non latin characters,
numbers and other symbols, that they are on the top of the list by default)
in the end of the list.

I tried some methods, such as set_sort_by_value, set_sort_by_key but I
always get the same error:

Fatal error: No matching function for overloaded 'Enquire_set_sort_by_value'


I use the PHP binding for Xapian.
It's probably I'm not calling these methods by the right way, could you
please help me?

Any information, idea or suggestion will be welcome.

Thanks in advance


On 20 March 2011 14:18, Olly Betts <olly at survex.com> wrote:

> On Tue, Mar 15, 2011 at 09:27:04AM +0000, The Craic Finder wrote:
> > Maybe I'm going to ask a bit weird question:
> >
> > I have an item collection, most of them are writting with latin letters,
> but
> > some of them have chinese letters. There is a list page and numbers,
> > punctuation and chinese letters go first. I would like to change this
> order
> > policy in order to show first items that start with latin letters, and
> then
> > numbers, punctuation and chinese letters,
> >
> > Is there a way to change the query order policy in Xapian?
>
> Are you talking about ordering of results?  I.e. Xapian::Enquire's
> set_sort_by_value() method.
>
> If so, then you need to adjust the strings so they sort (by raw byte
> comparisons) in the order you want.  You can either do this at index
> time and alter the values you set, or do it at search time with a
> subclass of Xapian::KeyMaker.
>
> Cheers,
>     Olly
>


More information about the Xapian-discuss mailing list