[Xapian-discuss] word pair indexing and querying

James Aylett james-xapian at tartarus.org
Thu Sep 21 13:01:31 BST 2006


On Thu, Sep 21, 2006 at 12:24:01PM +0100, Mark Hagger wrote:

> Is it possible, preferably using the simplistic scriptindex and
> cgi-bin/omega approach, to create and query a database so that I can
> force matches to only occur for word pairs.

You can set the default operator in omega to AND instead of OR. (Set
DEFAULTOP as an argument to the omega CGI.)

You can also use a phrase search, although this will be slower.

> For example I would want a match for "garden centre" but no match at
> all, or perhaps just a low relevance match, for the query "garden" or
> "centre".  Whereas my current approach using an indexscript with
> something like the following:
> 
> name : truncate=100 field=caption boolean=name index
> 
> and a data file with:
> 
> name=garden centre
> 
> means that I get 100% relevance matches for any of "garden", "centre" or
> "garden centre", which is rather unfortunate in my case.
> 
> Any thoughts/ideas/cunning plans would be appreciated.

Have you tried this with real data? Working with short test documents
often won't give you a realistic idea of what will actually happen.

Out of interest, why are you doing boolean=name? boolean=S would be
more usual, particularly if you want to use omega to search it.

J

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



More information about the Xapian-discuss mailing list