Discussion:
[Whoosh] Error while parsing long query string with group option : qparser.OrGroup.factory(0.9)
Kunal Ray
2015-03-11 05:03:59 UTC
Permalink
Hi,

I am using a multi-field query parser define as follows:
#Get a query parser
og = qparser.OrGroup.factory(0.9)
qpM = qparser.MultifieldParser(['title','abstract','context'],schema =
ix.schema,group = og)

When a long query string is given to this parser it crashes. However giving
the same string to the parser does not give any error if I change the group
argument to just OrGroup.
An example query string is given below:

Today the Internet offers a single path between end-systems even though it
intrinsically has a large multiplicity of paths. This paper proposes an
evolutionary architectural framework “BANANAS ” aimed at simplifying the
introduction of multipath routing in the Internet. The framework starts
with the observation that a path can be encoded as a short hash (“PathID”)
of a sequence of globally known identifiers. The PathID therefore has
global significance (unlike MPLS or ATM labels). This property allows
multipath capable nodes to autonomously compute PathIDs in a partially
upgraded network without requiring an explicit signaling protocol for path
setup. We show that this framework allows the introduction of sophisticated
explicit routing and multipath capabilities within the context of widely
deployed connectionless routing protocols (e.g. OSPF, IS-IS, BGP) or
overlay networks. We establish these characteristics through the
development of PathID encoding and routecomputation schemes. The BANANAS
framework also allows considerable flexibility in terms of architectural
function placement and complexity management. To illustrate this feature,
we develop an efficient variable-length hashing scheme that moves
control-plane complexity and state overheads to network edges, allowing a
very simple interior node design. All the schemes have been evaluated using
both sizable SSFNet simulations and Linux/Zebra implementation evaluated on
Utah’s Emulab testbed facility. 1.

The crash report shown in python shell is as follows :
................................................WhooshSearch.py", line 35,
in runQuery
qM = qpM.parse(qString)
File "build\bdist.win32\egg\whoosh\qparser\default.py", line 366, in parse
q = nodes.query(self)
File "build\bdist.win32\egg\whoosh\qparser\syntax.py", line 238, in query
subq = node.query(parser)
File "build\bdist.win32\egg\whoosh\qparser\syntax.py", line 238, in query
subq = node.query(parser)
File "build\bdist.win32\egg\whoosh\qparser\syntax.py", line 535, in query
removestops=self.removestops)
File "build\bdist.win32\egg\whoosh\qparser\default.py", line 233, in
term_query
fieldname, termclass, boost)
File "build\bdist.win32\egg\whoosh\qparser\default.py", line 192, in
multitoken_query
qclass = self.group.qclass
AttributeError: 'function' object has no attribute 'qclass'

From response of the system it appears that the trouble lies with using the
bonus scoring code : og = qparser.OrGroup.factory(0.9)

Could you help.

Regards

Kunal
--
You received this message because you are subscribed to the Google Groups "Whoosh" group.
To unsubscribe from this group and stop receiving emails from it, send an email to whoosh+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...