Open dkinzer opened 5 years ago
BAS tries to parse a boolean query, yes. This was a “feature”/requirement.
There’s no way to do that without making some ‘natural language’ things fail. There’s no way to fix this. See also recent discussion about “Portland OR bicycles”.
If you put the thing with parens in double quotes, it’ll probably work. (although the parens are probably stripped out by your Solr query parser anyway and have no effect on results).
print()
will fail, but I bet "print()"
will succeed.
I don’t know if there’s anything that can be done about this. I suppose there could be a feature to toggle off boolean query parsing, and just treat everything entered as a literal.
If you have boolean query parsing -- which was originally a requirement/goal/feature of this (now very old) library -- there are necessarily going to be things that don't parse.
Although I suppose it would also be better if you got an actual parse error as an exception here, instead of a kind of random uncaught exception. I'm not sure it's worth the effort to make that so, I don't think it will get you any closer to something you actually want.
So we’re getting a failure on from blacklight_advanced_search whenever we search anything with empty parens in it like “()” as the smallest case example. Anyone else see this… We are on the latest blacklight_advanced_search gem but we suspect issue goes back to other versions…. The error is
NoMethodError: undefined method `collect' for "()"@158:Parslet::Slice
and it’s getting thrown here