Calling ToString() on the query will display the string representation of the query for a user, but Mike is right, not all query types can go round trip from a string to a query through the QueryParser - SpanQuery, CustomScoreQuery, and PayloadQuery fall into this category.
Michael -----Original Message----- From: Mike Schenk [mailto:[email protected]] Sent: Wednesday, March 10, 2010 8:23 AM To: [email protected] Subject: RE: Working with Query classes I'm no power user, but I hunted for something similar and ended up switching off the concrete type like you mentioned. It's not even clear to me which concrete Query types can be produced by the QueryParser, but I don't believe all of them can. In particular, I don't believe the SpanQuery types can. ================================ Mike Schenk Senior Software Architect [email protected] 801-858-3800 - main 801-858-3821 - direct 801-858-3838 - fax ================================ -----Original Message----- From: Matt Honeycutt [mailto:[email protected]] Sent: Wednesday, March 10, 2010 6:59 AM To: [email protected] Subject: Working with Query classes Is there a "good" way to work with Query and its concrete implementations? I'd like to display a graphical representation of the user's query. We're parsing the user's input using the standard QueryParser class. What I'd like to do is extract all the criteria from the query and display them, but I don't see anything in the abstract Query class that is suitable for this. Is my only option to switch off the concrete type and treat each one differently, or am I overlooking some simpler solution?
