[Xapian-discuss] Re: Python bindings...

R. Mattes rm at mh-freiburg.de
Wed Aug 31 13:18:13 BST 2005


On Wed, 31 Aug 2005 09:24:14 +0200, Sebastjan Trepca wrote:

> Yes, that is a bit broken. But you don't need exactly that constructor
> to search the index. You can also use QueryParser or bind multiple
> Query objects together instead of multiple terms  in one Query which
> is the problematic constructor.
> 
> But it would be nice if this bug was fixed though :)
> 
> Sebastjan
> 
> On 30/08/05, Chris McDonough <chrism at plope.com> wrote:
>> Hi all,
>> 
>> I just got a hold of the 0.9.2 stable and SVN trunk sources in an
>> attempt to build Xapian on Linux for use with its Python bindings.
>> 
>> I am having some difficulty.  The 0.9.2 sources build fine and using
>> simpleindex.py works ok, but just as per this bug report from a bit ago:
>> 
>> http://lists.tartarus.org/pipermail/xapian-discuss/2005-June/000944.html
>> 
>> ... simplesearch.py does not.  It fails with "NotImplementedError: No
>> matching function for overloaded 'new_Query'".
>> 
>> If I take the try: except: out of simplesearch I end up with this
>> traceback on both Ubuntu Warty and Fedora Core 4 when attempting to use
>> that module after creating a database with simpleindex:
>> 
>> ~/projects/revelation/bin/python simplesearch.py foo cms
>> Traceback (most recent call last):
>>   File "simplesearch.py", line 42, in ?
>>     query = xapian.Query(xapian.Query.OP_OR, terms)
>>   File
>> "/home/chrism/projects/revelation/opt/Python-2.3.5/lib/python2.3/site-packages/xapian.py", line 663, in __init__
>>     newobj = _xapian.new_Query(*args)
>> NotImplementedError: No matching function for overloaded 'new_Query'
>> 
>> I have attempted this on FC4 and Ubuntu with the same result (actually I
>> needed to patch a header file for the sources to compile on FC4 due to
>> what I think is some extra pickiness of GCC4, but after compilation, the
>> same errors happen at runtime).
>> 
>> So I figured I'd try out the latest SVN trunk to see if it built its
>> Python bindings more correctly, but when I grab the SVN co, run
>> "./bootstrap" and then cd to "xapian-core" and run "configure; make", I
>> wind up with this compile-time error which appears to be an error in the
>> configure-generated makefile:
>> 
>> make[2]: *** No rule to make target `queryparser_internal.cc', needed by
>> `queryparser_internal.lo'.  Stop.
>> make[2]: Leaving directory
>> `/home/chrism/projects/revelation/build/xapian-core-20050621/queryparser'
>> make[1]: *** [install] Error 2
>> make[1]: Leaving directory
>> `/home/chrism/projects/revelation/build/xapian-core-20050621/queryparser'
>> make: *** [install-recursive] Error 1
>> 
>> This was not configured with maintainer-mode if it makes a difference.

I think it actually does. 'queryparser_internal.cc' is a generated file 
(made by running lemon on the grammar file) and will only be (re)created
whn you build in maintanier mode (you could be lazy  and just copy the
calls to build lemon and the generated files from the makefile and run
them manually). I've been bitten by that myself in the past ...

HTH Ralf Mattes


>> I tried checking out an older version with an arbitrary tag from cvs,
>> e.g.:
>> 
>> svn co --revision {07-21-2005} ....
>> 
>> ... and wind up in the same place with the queryparser makefile
>> problem.
>> 
>> I'm not too picky about which version I use as long as I can get one
>> going that seems to be able to index and search from Python.  Hoping
>> someone has run into one or both of the above problems and can provide
>> help.
>> 
>> My next step is to try to take a look at the build that is part of the
>> RPM spec file or .deb package to see if I'm just doing something dumb
>> during compilation but any help would be appreciated.
>> 
>> - C
>> 
>> 
>> 
>> _______________________________________________ Xapian-discuss mailing
>> list
>> Xapian-discuss at lists.xapian.org
>> http://lists.xapian.org/mailman/listinfo/xapian-discuss
>>





More information about the Xapian-discuss mailing list