[Xapian-discuss] Indexing and searching on a custom data type

James Aylett james-xapian at tartarus.org
Wed Jul 8 13:45:52 BST 2009

On Wed, Jul 08, 2009 at 02:17:05PM +0200, Thomas Chambon wrote:

> The data type is a "fuzzy date". It has a different internal
> representation in memory, and differents comparison operators than a
> date.
> I should have to implement those operators to do a comparison and being
> able to get only the documents which have a matching "fuzzy date" with
> the one I have put in the xapian search request. I have to be able to
> sort the results on their "fuzzy date".

The comparison for matching you may be able to do by splitting the
fuzziness into several terms. The sorting I would, if possible,
implement by coming up with a string serialisation that sorts
correctly according to the rules, although this may not be possible.

Alternatively, you can indeed implement this in code. For sorting,
look at Xapian::Sorter, and for matching look at Xapian::MatchDecider.


  James Aylett

  talktorex.co.uk - xapian.org - uncertaintydivision.org

More information about the Xapian-discuss mailing list