-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoMethodError: undefined method `collect' for "()"@158:Parslet::Slice #101
Comments
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).
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. |
If an empty param,`()`, is included in a query, the boolen query parser included from advanced search gem throws an error. It is documented as an issue upstream at projectblacklight/blacklight_advanced_search#101, but at the moment no fix upstream is proposed. This PR works around the issue by removing empty parens from the query string. It does not impact parens containing content.
This change allows an empty set of parens, `()`, to be in a string and to be parsed as a token. Prior to this change, and empty set of parens would be parsed as a list with no contents which could not be successfully parsed, but instead results in a error as described in projectblacklight#101. This change fixes issue projectblacklight#101.
This change allows an empty set of parens, `()`, to be in a string and to be parsed as a token. Prior to this change, and empty set of parens would be parsed as a list with no contents which could not be successfully parsed, but instead results in a error as described in projectblacklight#101. This change fixes issue projectblacklight#101.
This change allows an empty set of parens, `()`, to be in a string and to be parsed as a token. Prior to this change, and empty set of parens would be parsed as a list with no contents which could not be successfully parsed, but instead results in a error as described in projectblacklight#101. This change fixes issue projectblacklight#101.
This change allows an empty set of parens, `()`, to be in a string and to be parsed as a token. Prior to this change, and empty set of parens would be parsed as a list with no contents which could not be successfully parsed, but instead results in a error as described in #101. This change fixes issue #101.
This change allows an empty set of parens, `()`, to be in a string and to be parsed as a token. Prior to this change, and empty set of parens would be parsed as a list with no contents which could not be successfully parsed, but instead results in a error as described in #101. This change fixes issue #101.
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
The text was updated successfully, but these errors were encountered: