<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=굴림 size=2>I want to get term list from Query object right
after qp.parse_query().</FONT></DIV>
<DIV><FONT face=굴림 size=2>But my program written in python generates an
error.</FONT></DIV>
<DIV><FONT face=굴림 size=2>What's wrong with me? </FONT></DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2>Sungsoo Kim</FONT></DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2>-------------------------</FONT></DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2>database = xapian.Database(db)</FONT></DIV>
<DIV><FONT face=굴림 size=2>qp =
xapian.QueryParser()<BR>qp.set_database(database)<BR>qp.set_default_op(xapian.Query.OP_AND)<BR>qp.set_stemming_strategy(xapian.QueryParser.STEM_NONE)<BR>query
= qp.parse_query(input, xapian.QueryParser.FLAG_LOVEHATE)<BR>enquire =
xapian.Enquire(database)</FONT></DIV>
<DIV><FONT face=굴림 size=2>enquire.set_query(query)</FONT></DIV>
<DIV><FONT face=굴림 size=2>print "Performing query '%s'" %
query.get_description()</FONT></DIV>
<DIV><FONT face=굴림 size=2>for term in query: print term</FONT></DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2></FONT> </DIV>
<DIV><FONT face=굴림 size=2>$ python search.py -v cup book</FONT></DIV>
<DIV><FONT face=굴림 size=2>
<DIV><FONT face=굴림 size=2>Performing query 'Xapian::Query((cup:(pos=1) AND
book:(pos=2)))'</FONT></DIV>Traceback (most recent call last):<BR> File
"search.py", line 197, in ?<BR> main()<BR> File
"search.py", line 191, in main<BR>
search(string.join(args))<BR> File "search.py", line 77, in
search<BR> for term in query: print term<BR> File
"/usr/lib64/python2.3/site-packages/xapian.py", line 747, in
next<BR> r = [self.iter.get_term(), self.iter.get_wdf(),
self.iter.get_termfreq(), PositionIter(self.iter.positionlist_begin(),
self.iter.positionlist_end())]<BR> File
"/usr/lib64/python2.3/site-packages/xapian.py", line 186, in
get_termfreq<BR> def get_termfreq(*args): return
_xapian.TermIterator_get_termfreq(*args)<BR>RuntimeError: InvalidOperationError:
VectorTermList::get_termfreq() not supported<BR></FONT><FONT face=굴림
size=2></DIV></FONT></BODY></HTML>