[Xapian-discuss] some problems and prefixes

Olly Betts olly at survex.com
Fri Jun 19 08:17:57 BST 2009


On Fri, Jun 19, 2009 at 12:03:46AM +0200, Rafi wrote:
> $database = new XapianWritableDatabase(XAPIAN_DB_FILE, Xapian::DB_CREATE_OR_OVERWRITE );

Um, what's XAPIAN_DB_FILE?

> after that, database was created, all docs was indexed, but..
> $database->get_doccount() has return 0, strange, but after changing to
> DB_CREATE_OR_OPEN, everything was working almost perfect. Now when Im
> indexing documents, I've to index them twice.
> When I use $database->flush(); (and there is no any files yet) I get
> error: DatabaseError: Error reading from file. After second indexing
> everything is working fine (hocus-pocus).

Sounds very odd, but I've no idea what's going on.  I think you'll need
to show us a self-contained example which demonstrates this behaviour.

On Fri, Jun 19, 2009 at 01:56:36AM +0200, Rafi wrote:
> creatign term eg: XC:category

Or just XCcategory...

> quering for: XC:category
> add_prefix('shopid', 'XC');
> 
> and then users can search by typing:
> 
> shopid:23 just like in google site:host.com :)

Yes, though for a filter term like this add_boolean_prefix() makes more
sense than add_prefix() - the latter is for "free text" prefixes.

Cheers,
    Olly



More information about the Xapian-discuss mailing list