-Re: ANTLR SOLR query/filter parser
Chris Hostetter 2011-08-17, 19:26
: I'm looking for an ANTLR parser that consumes solr queries and filters.
: Before I write my own, thought I'd ask if anyone has one they are
: willing to share or can point me to one?
I'm pretty sure that this will be imposisble to do in the general case --
arbitrary QParser instances (that support arbitrary syntax) can be
registered in the solrconfig.xml and specified using either localparams or
defType. so even if you did write a parser that understood all of the
rules of all of hte default QParsers, and even if you made your parser
smart enough to know how to look at other params (ie: defType, or
variable substitution of "type") to understand which subset of parse rules
to use, that still might give false positives or false failures if hte
user registered their own QParser using a new name (or changed the
names used in registrating existing parsers)
The main question i have is: why are you looking for an ANTLR paser to do
this? what is your goal?
Your question appears to be an "XY Problem" ... that is: you are dealing
with "X", you are assuming "Y" will help you, and you are asking about "Y"
without giving more details about the "X" so that we can understand the
full issue. Perhaps the best solution doesn't involve "Y" at all?
See Also: http://www.perlmonks.org/index.pl?node_id=542341