weixin_39535349
weixin_39535349
2020-12-09 07:58

Treetop 1.5.0 breaks search query parser

Treetop just updated to 1.5.0 and breaks LuceneParser e.g.:


# treetop 1.4.1:
Query.parse('foo:bar AND baz:quaz')
=> Body offset=0, "foo:bar AND baz:quaz":
  BinaryOp+BinaryOp0 offset=0, "foo:bar AND baz:quaz" (boolean_operator,body):
    Field+Field0 offset=0, "foo:bar" (field_name):
      FieldName+FieldName0 offset=0, "foo"
      Term+Term1 offset=4, "bar" (valid_letter)
    AndOperator offset=8, "AND"
    Body offset=12, "baz:quaz":
      Field+Field0 offset=12, "baz:quaz" (field_name):
        FieldName+FieldName0 offset=12, "baz"
        Term+Term1 offset=16, "quaz" (valid_letter)

# treetop 1.5.0:
Query.parse('foo:bar AND baz:quaz')
=> Body offset=0, "foo:bar AND baz:quaz":
  Field+Field0 offset=0, "foo:bar" (field_name):
    FieldName+FieldName0 offset=0, "foo"
    Term+Term1 offset=4, "bar" (valid_letter)
  Term+Term1 offset=8, "AND" (valid_letter)
  Field+Field0 offset=12, "baz:quaz" (field_name):
    FieldName+FieldName0 offset=12, "baz"
    Term+Term1 offset=16, "quaz" (valid_letter)

该提问来源于开源项目:edelight/chef-solo-search

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39623273 weixin_39623273 4月前

    This was a defect in the case-insensitive matching in Treetop 1.5.0 - fixed just now in 1.5.1. Thanks for the report, please re-test with 1.5.1.

    点赞 评论 复制链接分享
  • weixin_39616348 weixin_39616348 4月前

    Would it be wise to fix the treetop gem install to a known stable version with solo-search? 1.5.0 broke some cookbook dependencies (such as the users cookbook) that use AND queries. Happy to put in the PR.

    点赞 评论 复制链接分享
  • weixin_39560002 weixin_39560002 4月前

    please. http://www.ruby-doc.org/stdlib-1.9.3/libdoc/rubygems/rdoc/Kernel.html#method-i-gem

    点赞 评论 复制链接分享
  • weixin_39623273 weixin_39623273 4月前

    I yanked the broken 1.5.0 Treetop version, which was only online for 24 hours anyway. You shouldn't need to take any further action.

    点赞 评论 复制链接分享
  • weixin_39616348 weixin_39616348 4月前

    I'm going to set my repo to 1.5.1, so it doesn't break chef deployments with future builds (like it did yesterday). I'm testing my changes atm. Will probably change this in the future with bugs or any security patches. This seems like a best practice for the way we're using solo-search (although you seem to be on top of treetop bug fixes . thanks! ). I can still put in a PR if people want the main repo to use this.

    点赞 评论 复制链接分享
  • weixin_39623273 weixin_39623273 4月前

    1.5.2 is already in Github. I'm pretty sure you don't want to lock the main repo to 1.5.1

    点赞 评论 复制链接分享
  • weixin_39560002 weixin_39560002 4月前

    the point is we'll bring in new versions as needed / with testing.

    点赞 评论 复制链接分享

相关推荐