Export to GitHub

bobo-browse - issue #20

BrowseProtobufConverter loses information during conversion of queries


Posted on Aug 16, 2009 by Massive Elephant

What steps will reproduce the problem? 1. Create a BrowseRequest with a MatchAllDocsQuery type query 2. convert the BrowseRequest into a BrowseRequestBPO.Request 3. convert the resulting BrowseRequestBPO.Request back to a BrowseRequest

We should expect to get a BrowseRequest back with MatchAllDocsQuery. But we get back a BrowseRequest with a TermQuery.

Comment #1

Posted on Aug 16, 2009 by Massive Elephant

The information loss is not restricted to just MatchAllDocsQuery.

Comment #2

Posted on Aug 16, 2009 by Massive Elephant

Conversion using Query.toString does not work for MatchAllDocsQuery from lucene, whose toString() method returns "MatchAllDocsQuery" instead of the query string ":", which can be parsed. The fact that MatchAllDocsQuery class does not override toString() method should be considered a defect in Lucene 2.4.

Using QueryParser to parse a query string may change the class type of the Query that we start from. For example, a WildCardQuery of "xx*" will be parsed into a PrefixQuery, which is quite appropriate.

Status: Fixed

Labels:
Type-Defect Priority-High Component-Logic