[Xapian-discuss] indexing for newbies?

James Aylett james-xapian at tartarus.org
Sat Sep 20 13:37:04 BST 2008


On Fri, Sep 19, 2008 at 02:37:39PM +0200, Bobo Wieland wrote:

> I find it hard to find suitable documentation or articles about
> indexing. Either it's too simple, or it's just the generated
> documentation of the xapian-classes.

I assume you've read the quickstart and the glossary (the latter on
the wiki).

The most important thing that I don't think you've grasped yet is that
whatever you consider to be the smallest thing you search for should
be a Xapian Document. I think in your case that will be a row in any
of the three tables you have in your SQL database. Each Xapian
Document contains a number of terms - these are the main things that
are searched against. The easiest way of building the list of terms is
to use the TermGenerator - see the documentation for this. (I think
Richard added a FAQ or wiki document on it recently as well.)

> I thought of using terms XPLAYER, XCLUB and XCOMPETITION for keeping
> the results grouped.

That's not a great approach, because it's not what the 'X' prefix is
designed for. 'X' allows you to create additional prefixes, eg:
'XCOLOUR' or 'XSPECIES'. You probably want terms like 'XTYPEplayer'
,'XTYPEclub', 'XTYPEcompetition' if you need this kind of
information. That will allow you to search only one type of thing at a
time, as well as across all the types.

You also may well want to have the type stored in the Document data
(set_data/get_data) so you can display things suitably.

> And I need some range search for StartDate and EndDate, right?

Probably. 

If you can point to the places in the documentation where you'd expect
to find any of the statements above, or something else I haven't
covered, we can try to improve things.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list