FAQ
Hi everybody,

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?

Thanks in advance.

Search Discussions

  • Olly Betts at Mar 20, 2011 at 2:18 pm

    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
  • The Craic Finder at Apr 12, 2011 at 11:11 am
    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 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupxapian-discuss @
categoriesxapian
postedMar 15, '11 at 9:27a
activeApr 12, '11 at 11:11a
posts3
users2
websitexapian.org
irc#xapian

2 users in discussion

The Craic Finder: 2 posts Olly Betts: 1 post

People

Translate

site design / logo © 2022 Grokbase