{"comment":{"created_at":"2011-10-12T18:35:04Z","body":"Rusty, please look over the 055e41e change that I just pushed.\r\nOtherwise, +1 to merge ... though it'd be really *really* cool if the\r\ntesting recipe above were basho_expect'ified....","updated_at":"2011-10-12T18:35:04Z","url":"https://api.github.com/repos/basho/riak_search/issues/comments/2382749","id":2382749,"user":{"avatar_url":"https://secure.gravatar.com/avatar/060adbfc2ae29925cf68444fe90fbc8c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/slfritchie","id":75320,"login":"slfritchie"}},"action":"created","issue":{"number":91,"created_at":"2011-10-12T16:55:05Z","pull_request":{"diff_url":"https://github.com/basho/riak_search/pull/91.diff","patch_url":"https://github.com/basho/riak_search/pull/91.patch","html_url":"https://github.com/basho/riak_search/pull/91"},"body":"Rewrote and simplified exact phrase and proximity matching logic to correctly handle exact phrase searches with repeated terms. Added unit tests around the tricky bits.\r\n\r\nTo test:\r\n\r\n```bash\r\n# Install the search hook on bucket 'books'.\r\nbin/search-cmd install books\r\n\r\n# Load some data...\r\ncurl -X POST \\\r\n    -d \"one fish two fish red fish blue fish\" \\\r\n    localhost:8098/riak/books/book1\r\n\r\ncurl -X POST \\\r\n    -d \"see spot see spot run\" \\\r\n    localhost:8098/riak/books/book2\r\n\r\ncurl -X POST \\\r\n    -d \"it was the best of times it was the worst of times\" \\\r\n    localhost:8098/riak/books/book3\r\n\r\n# This used to fail, now it successfully finds a result...\r\nbin/search-cmd search books \"\\\"one fish two fish\\\"\"\r\n\r\n# Some positive tests...\r\nbin/search-cmd search books \"fish\"\r\nbin/search-cmd search books \"\\\"one fish\\\"\"\r\nbin/search-cmd search books \"\\\"one fish two fish\\\"\"\r\nbin/search-cmd search books \"\\\"one fish two fish\\\" OR \\\"see spot see spot\\\"\"\r\nbin/search-cmd search books \"\\\"one two red blue\\\"~7\"\r\nbin/search-cmd search books \"\\\"one two red blue\\\"~7 OR \\\"see run\\\"~3\"\r\n\r\n# Some negative tests (ie: these are expected to return zero results)\r\nbin/search-cmd search books \"fish AND foo\"\r\nbin/search-cmd search books \"\\\"fish one\\\"\"\r\nbin/search-cmd search books \"\\\"one fish fish two\\\"\"\r\nbin/search-cmd search books \"\\\"one fish fish two\\\" OR \\\"see spot spot see\\\"\"\r\nbin/search-cmd search books \"\\\"one two red blue\\\"~6\"\r\nbin/search-cmd search books \"\\\"one two red blue\\\"~6 OR \\\"see run\\\"~2\"\r\n```","comments":1,"title":"Fix exact phrase searching with repeated terms (AZ847, BZ1225)","updated_at":"2011-10-12T18:35:04Z","url":"https://api.github.com/repos/basho/riak_search/issues/91","id":1889578,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/71e5d5bae85bfab0a3b8314fd7daa423?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/rustyio","id":28964,"login":"rustyio"},"html_url":"https://github.com/basho/riak_search/issues/91","labels":[],"state":"open"},"legacy":{"issue_id":1889578,"comment_id":2382749}}