On Sep 18, 2011, at 19:43 , Michael Sokolov wrote:
> On 9/15/2011 8:30 PM, Scott Smith wrote:
>>
>> 2. Assuming that the answer to 1 is "correct", then is there an easy
>> way to take a lucene query (with nested Boolean queries, filter queries,
>> etc.) and generate a SOLR query string with q and fq components?
>>
>>
> I believe that Query.toString() will probably get you back something that can
> be parsed in turn by the traditional lucene QueryParser, thus completing the
> circle and returning your original Query. But why would you want to do that?
No, you can't rely on Query.toString() roundtripping (think stemming, for
example - but many other examples that won't work that way too).
What you can do, since you know Lucene's API well, is write a QParser(Plugin)
that takes request parameters as strings and generates the Query from that like
you are now with your Lucene app.
Erik