query-parser
query-parser copied to clipboard
chunk + to_h not working as expected
hey @look, enjoyed your article and used some of your code in own project. Thank you so much! Just wanted to let you know about a possible small mistake here: https://github.com/look/query-parser/blob/6049469db352f937d0d88300dd0986b86b14e3b3/phrase_parser.rb#L71 chunk.to_h is only keeping the last element for each group in the array for each operator. To fix I used grouped = clauses.group_by(&:operator) instead. Ruby version is 2.1.0
Thanks for the report! I'll take a look and update the code.