[Xapian-discuss] Problems with scriptindex

Olly Betts olly at survex.com
Mon Dec 5 03:18:51 GMT 2011


On Fri, Dec 02, 2011 at 11:42:24AM +0100, stephane altazin wrote:
> I am trying to use scriptindex but I get some problems :
> 1) If my script file is empty I have an indexation by default, and I get
> two output fields when I am using quest.exe (These fields are caption and
> sample)

You don't say what version you're using, but with the current 1.2 branch
(which hasn't changed much since 1.2.7) I just get an empty document if
the index script is empty (which is what I'd expect).

Perhaps you didn't start from a clean database?  You can pass
--overwrite to scriptindex to force it to empty the database first.

On trunk, I've tweaked scriptindex to report an error if no rules were
found in the index script, since the result (adding empty documents to
the database) is clearly not useful.

> 2) I then tryed to not use an empty script file defining this time my
> own fields, but if I use quest to perform researches these fileds does
> not appear in the output.

Works for me:

$ scriptindex tmp.db tmp.script tmp.data
records (added, replaced, deleted) = (1, 0, 0)
$ quest -d tmp.db picture
Parsed Query: Xapian::Query(Zpictur:(pos=1))
MSet:
1 [100%]
author=Aristotle
date=20041204
translator=E. M. Edghill
url='/phil/aristotle-categories-79.txt'

Incidentally, I suspect you don't want those quotes around the URL -
scriptindex doesn't expected quoted values - it'll assume quotes (and
any other characters) are to be handled literally.

Cheers,
    Olly



More information about the Xapian-discuss mailing list