{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/kibana/issues/7701","repository_url":"https://api.github.com/repos/elastic/kibana","labels_url":"https://api.github.com/repos/elastic/kibana/issues/7701/labels{/name}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/7701/comments","events_url":"https://api.github.com/repos/elastic/kibana/issues/7701/events","html_url":"https://github.com/elastic/kibana/pull/7701","id":164720050,"number":7701,"title":"fix #7332 - saving vis with % in name causes error","user":{"login":"ppisljar","id":13629809,"avatar_url":"https://avatars.githubusercontent.com/u/13629809?v=3","gravatar_id":"","url":"https://api.github.com/users/ppisljar","html_url":"https://github.com/ppisljar","followers_url":"https://api.github.com/users/ppisljar/followers","following_url":"https://api.github.com/users/ppisljar/following{/other_user}","gists_url":"https://api.github.com/users/ppisljar/gists{/gist_id}","starred_url":"https://api.github.com/users/ppisljar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppisljar/subscriptions","organizations_url":"https://api.github.com/users/ppisljar/orgs","repos_url":"https://api.github.com/users/ppisljar/repos","events_url":"https://api.github.com/users/ppisljar/events{/privacy}","received_events_url":"https://api.github.com/users/ppisljar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/kibana/labels/review","name":"review","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"Bargs","id":6239176,"avatar_url":"https://avatars.githubusercontent.com/u/6239176?v=3","gravatar_id":"","url":"https://api.github.com/users/Bargs","html_url":"https://github.com/Bargs","followers_url":"https://api.github.com/users/Bargs/followers","following_url":"https://api.github.com/users/Bargs/following{/other_user}","gists_url":"https://api.github.com/users/Bargs/gists{/gist_id}","starred_url":"https://api.github.com/users/Bargs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bargs/subscriptions","organizations_url":"https://api.github.com/users/Bargs/orgs","repos_url":"https://api.github.com/users/Bargs/repos","events_url":"https://api.github.com/users/Bargs/events{/privacy}","received_events_url":"https://api.github.com/users/Bargs/received_events","type":"User","site_admin":false},"assignees":[{"login":"Bargs","id":6239176,"avatar_url":"https://avatars.githubusercontent.com/u/6239176?v=3","gravatar_id":"","url":"https://api.github.com/users/Bargs","html_url":"https://github.com/Bargs","followers_url":"https://api.github.com/users/Bargs/followers","following_url":"https://api.github.com/users/Bargs/following{/other_user}","gists_url":"https://api.github.com/users/Bargs/gists{/gist_id}","starred_url":"https://api.github.com/users/Bargs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bargs/subscriptions","organizations_url":"https://api.github.com/users/Bargs/orgs","repos_url":"https://api.github.com/users/Bargs/repos","events_url":"https://api.github.com/users/Bargs/events{/privacy}","received_events_url":"https://api.github.com/users/Bargs/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2016-07-10T15:19:06Z","updated_at":"2016-07-15T20:18:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/7701","html_url":"https://github.com/elastic/kibana/pull/7701","diff_url":"https://github.com/elastic/kibana/pull/7701.diff","patch_url":"https://github.com/elastic/kibana/pull/7701.patch"},"body":"Fixes #7332 \r\n\r\n- slugify_id.js utility was updated to replace % sign with -percentage-\r\n- tests for slugify_id utility were updated\r\n\r\nI was looking for UI test of saving visualization but couldn't locate it .. can you please help me locate it ?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/kibana/issues/comments/233059428","html_url":"https://github.com/elastic/kibana/pull/7701#issuecomment-233059428","issue_url":"https://api.github.com/repos/elastic/kibana/issues/7701","id":233059428,"user":{"login":"Bargs","id":6239176,"avatar_url":"https://avatars.githubusercontent.com/u/6239176?v=3","gravatar_id":"","url":"https://api.github.com/users/Bargs","html_url":"https://github.com/Bargs","followers_url":"https://api.github.com/users/Bargs/followers","following_url":"https://api.github.com/users/Bargs/following{/other_user}","gists_url":"https://api.github.com/users/Bargs/gists{/gist_id}","starred_url":"https://api.github.com/users/Bargs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bargs/subscriptions","organizations_url":"https://api.github.com/users/Bargs/orgs","repos_url":"https://api.github.com/users/Bargs/repos","events_url":"https://api.github.com/users/Bargs/events{/privacy}","received_events_url":"https://api.github.com/users/Bargs/received_events","type":"User","site_admin":false},"created_at":"2016-07-15T20:18:09Z","updated_at":"2016-07-15T20:18:09Z","body":"> strings with special charracters are not found unless we add a space after it (searching for \"test %*\" wont work but searching for \"test % *\" will )\r\n\r\nI don't think this is quite the right solution. As far as I can tell, `foo=*` wouldn't match the title `foo=` because queries using `*` don't get analyzed, whereas the visualization title field *is* analyzed. What this means is, the title `foo=` would get stored under just `foo` in the inverted index, because the term is split into tokens on word dividers like `=` (based on the field's analyzer). A query with `foo=*` will try to find an exact match for `foo=`, which it won't find.\r\n\r\nThe reason why adding a space sort of works is that it's splitting the query string into two tokens: `foo` and `*`. That's my understanding at least, analyzed fields are complicated. So the downside to adding a space after special chars is that the list of special chars we need to handle is based on the field analyzer defined in the elasticsearch mapping, and we probably don't want to couple these things together.\r\n\r\nLong story short, I think the correct solution here is to add the `analyze_wildcard: true` param to the query body. This will split a query like `foo=*` into the tokens we want and successfully match the title `foo=`. This solution would also match a title like `foo=bar` with a query string like `foo=b`, which neither the current code or the whitespace based solution would handle correctly."}}
{"actor":{"display_login":"Bargs"}}