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 would like a push in the right direction here. As I've stated in previous posts I'm new to xapian. I will explain the project I'm about to start working on and any help is appreciated. I have three tables in mysql that should be indexed for searching. You should get hits from all three tables with a single search (but grouped by table). The tables are "players","clubs","competitions". The searchable fields for each table should be: The players table: Licensnumber (unique), Firstname, Lastname, ClubName, Geografical region The clubs table: ClubName, Geografical region The competitions table: CompetitionName, StartDate, EndDate, Organizer (a ClubName), Geografical region I thought of using terms XPLAYER, XCLUB and XCOMPETITION for keeping the results grouped. And I need some range search for StartDate and EndDate, right? Thing is I have no idea how to do this. How do I add the rows to the xapian database and how do I define the terms? I use the php bindings and xapian through a webserver... mvh Bobo Wieland - Kodstationen AB ------------------------------------------------- Kodstationen AB J?rnv?gsstationen 262 52 ?ngelholm ------------------------------------------------- Tel: 0735 - 880 100 E-post: bobo at kodlabbet.se ------------------------------------------------- Detta e-mail skickades via SilverCRM http://www.silvercrm.se
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
Hi again. I _know_ that this is asking a lot, but I have no idea how to do this. As I've said in my previous mail (see below) I think xapian.org lacks a good guide of how to do things. (btw I use the php-bindings) Anyway, this is an example of one piece of data i want to index - but I don't know how to do it. The capital prefix to each row is just some way for me to inform you what the data is, it has nothing to do with xapian...: NAME_OF_COMPETITION Upsala Elit Jr Cup START_DATE 2008-09-19 END_DATE 2008-09-28 GEOGRAFIC_REGION Uppsala GEOGRAFIC_REGION Uppland GEOGRAFIC_REGION Region Mitt ORGANIZER usif CLASS P12 CLASS_P12_DATE 2008-09-14 CLASS P14 CLASS_P14_DATE 2008-09-14 CLASS PD14 CLASS_PD14_DATE 2008-09-22 CLASS F12 CLASS_F12_DATE 2008-09-14 CLASS F14 CLASS_F14_DATE 2008-09-14 CLASS FD14 CLASS_FD14_DATE 2008-09-22 If I want to register for a competition and I'm in the class F12 I will search for competitions that has a F12 class and that is open for registration (that is all competition that has CLASS_F12_DATE < today). This I will do through an advanced search form. I don't need any help with the search form but how to index data like the data above to make searches as the one i specified possible. mvh Bobo Wieland - Kodstationen AB ------------------------------------------------- Kodstationen AB J?rnv?gsstationen 262 52 ?ngelholm ------------------------------------------------- Tel: 0735 - 880 100 E-post: bobo at kodlabbet.se ------------------------------------------------- Detta e-mail skickades via SilverCRM http://www.silvercrm.se Bobo Wieland <bobo at kodlabbet.se> skrev:> >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 would like a push in the right direction here. As I've stated in >previous posts I'm new to xapian. I will explain the project I'mabout>to start working on and any help is appreciated. > >I have three tables in mysql that should be indexed for searching. >You should get hits from all three tables with a single search (but >grouped by table). The tables are "players","clubs","competitions". > >The searchable fields for each table should be: >The players table: >Licensnumber (unique), >Firstname, >Lastname, >ClubName, >Geografical region > >The clubs table: >ClubName, >Geografical region > >The competitions table: >CompetitionName, >StartDate, >EndDate, >Organizer (a ClubName), >Geografical region > > >I thought of using terms XPLAYER, XCLUB and XCOMPETITION for keeping >the results grouped. And I need some range search for StartDate and >EndDate, right? > >Thing is I have no idea how to do this. How do I add the rows to the >xapian database and how do I define the terms? > > >I use the php bindings and xapian through a webserver... > > > > >mvh > >Bobo Wieland - Kodstationen AB >------------------------------------------------- >Kodstationen AB >J?rnv?gsstationen >262 52 ?ngelholm >------------------------------------------------- >Tel: 0735 - 880 100 >E-post: bobo at kodlabbet.se >------------------------------------------------- >Detta e-mail skickades via SilverCRM >http://www.silvercrm.se > >