FAQ
I am sorry I broke the reply thread, but your response didn't get to my
mailbox, I saw it on GMANE.

Olly Betts <olly <at> survex.com> writes:
The search script looks plausible. I think if you actually add some
postings it'll all start to work.

Cheers,
Olly
Thanks for the pointers, according to the delve tool I am getting terms
added
from the add_posting() and the data is there, but I can't get the search to
work. Here is my REALLY simple search since I only want to search on a
single term!

#!/usr/bin/python
import sys
import xapian

if len(sys.argv) < 3:
print >> sys.stderr, "usage: %s <path to database> <search terms>" %
sys.argv[0]
sys.exit(1)

try:
database = xapian.Database( sys.argv[1] )

enquire = xapian.Enquire(database)
query = xapian.Query( sys.argv[2] )
print "Performing query `%s'" % query.get_description()

enquire.set_query(query)
matches = enquire.get_mset(0, 10)

print "%i results found" % matches.get_matches_estimated()
for match in matches:
print "ID %i %i%% [%s]" % (match[xapian.MSET_DID],
match[xapian.MSET_PERCENT], match[xapian.MSET_DOCUMENT].get_data())

except Exception, e:
print "Exception: %s" % str(e)
sys.exit(1)

Here is what delve tells me:
delve -r 999 -d /tmp/index
Data for record #999:
/wfs/R/t/3/Rt3oxJib36zNefmMEqJ9FVNyCUE=/SecUpd2005-006Ti.info
/d647d4a0-57c0-11da-be78-080020b7eac9

Term List for record #999: d647d4a0-57c0-11da-be78-080020b7eac9

and here is what my searcher.py program tells me:
searcher.py /tmp/index d647d4a0-57c0-11da-be78-080020b7eac9
Performing query `Xapian::Query(d647d4a0-57c0-11da-be78-080020b7eac9)'
0 results found

any ideas what I am missing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.tartarus.org/pipermail/xapian-discuss/attachments/20060119/4d272ef8/attachment.htm

Search Discussions

  • Olly Betts at Feb 3, 2006 at 5:26 am

    On Thu, Jan 19, 2006 at 04:51:31PM -0500, jarrod roberson wrote:
    Here is what delve tells me:
    delve -r 999 -d /tmp/index
    Data for record #999:
    /wfs/R/t/3/Rt3oxJib36zNefmMEqJ9FVNyCUE=/SecUpd2005-006Ti.info
    /d647d4a0-57c0-11da-be78-080020b7eac9

    Term List for record #999: d647d4a0-57c0-11da-be78-080020b7eac9

    and here is what my searcher.py program tells me:
    searcher.py /tmp/index d647d4a0-57c0-11da-be78-080020b7eac9
    Performing query `Xapian::Query(d647d4a0-57c0-11da-be78-080020b7eac9)'
    0 results found

    any ideas what I am missing?
    All I can think of is that the term in the database might have whitespace
    on the end (spaces, tabs, or newlines).

    What's the exact output of:

    delve -r 999 /tmp/index | cat -vet

    Cheers,
    Olly
  • Olly Betts at Feb 3, 2006 at 5:33 am

    On Fri, Feb 03, 2006 at 05:26:19AM +0000, Olly Betts wrote:
    All I can think of is that the term in the database might have whitespace
    on the end (spaces, tabs, or newlines).
    Aha, I just got to your follow-up to the duplicate of the message I
    replied to, and I guessed right!

    Cheers,
    Olly

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupxapian-discuss @
categoriesxapian
postedJan 19, '06 at 9:51p
activeFeb 3, '06 at 5:33a
posts3
users2
websitexapian.org
irc#xapian

2 users in discussion

Olly Betts: 2 posts Jarrod roberson: 1 post

People

Translate

site design / logo © 2022 Grokbase