[Xapian-discuss] Python bindings

James Aylett james-xapian at tartarus.org
Sat Apr 26 23:31:59 BST 2008


On Sat, Apr 26, 2008 at 03:39:00PM +0100, Iain Emsley wrote:

> I've just started with Xapian using the Python bindings and have been using
> the example texts to begin understanding how the programme works.
> 
> I've been running simpleindex.py off the command line to read a directory
> (C:\test) where a  file called pl.txt exists. The command I entered was
> python c:\pathtoxapian c:\test but the line does not appear to do anything
> and hangs.  If I try and set the path c:\test\pl.txt directly, then I get
> the exception no flint database found at path c:\test\pl.txt.
> 
> I'm ultimately wanting to get Xapian looking for a set of files in a
> directory defined with a certain word at the beginning of the filename.
> 
> Could anybody please let me know what I'm doing incorrectly so that I can
> really get my head into this?

simpleindex.py takes a single argument: the database directory. (Which
is why it complained about no flint database found at c:\test\pl.txt
.) The data to index must then be fed in on stdin.

You may prefer to modify simpleindex.py to take a second argument, a
file to read in instead of stdin. I think this is probably a two line
change or so.

J

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



More information about the Xapian-discuss mailing list