{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/33792815","id":33792815,"diff_hunk":"@@ -19,38 +19,69 @@\n \n package org.elasticsearch.index.query;\n \n+import org.apache.lucene.index.Term;\n+import org.apache.lucene.search.MultiTermQuery;\n+import org.apache.lucene.search.Query;\n+import org.apache.lucene.search.RegexpQuery;\n import org.apache.lucene.util.automaton.Operations;\n+import org.elasticsearch.common.Strings;\n+import org.elasticsearch.common.io.stream.StreamInput;\n+import org.elasticsearch.common.io.stream.StreamOutput;\n+import org.elasticsearch.common.lucene.BytesRefs;\n import org.elasticsearch.common.xcontent.XContentBuilder;\n+import org.elasticsearch.index.mapper.MappedFieldType;\n+import org.elasticsearch.index.query.support.QueryParsers;\n \n import java.io.IOException;\n+import java.util.Objects;\n \n /**\n  * A Query that does fuzzy matching for a specific value.\n  */\n-public class RegexpQueryBuilder extends MultiTermQueryBuilder {\n+public class RegexpQueryBuilder extends MultiTermQueryBuilder<RegexpQueryBuilder> {\n \n     public static final String NAME = \"regexp\";\n-    private final String name;\n-    private final String regexp;\n \n-    private int flags = -1;\n+    public static final int DEFAULT_FLAGS_VALUE = RegexpFlag.ALL.value();\n+\n+    public static final int DEFAULT_MAX_DETERMINIZED_STATES = Operations.DEFAULT_MAX_DETERMINIZED_STATES;\n+\n+    private final String fieldName;\n+    \n+    private final String value;","path":"core/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java","position":37,"original_position":37,"commit_id":"ba70a7163335a695d73c1dc68ae1f203447d87d3","original_commit_id":"ba70a7163335a695d73c1dc68ae1f203447d87d3","user":{"login":"alexksikes","id":43475,"avatar_url":"https://avatars.githubusercontent.com/u/43475?v=3","gravatar_id":"","url":"https://api.github.com/users/alexksikes","html_url":"https://github.com/alexksikes","followers_url":"https://api.github.com/users/alexksikes/followers","following_url":"https://api.github.com/users/alexksikes/following{/other_user}","gists_url":"https://api.github.com/users/alexksikes/gists{/gist_id}","starred_url":"https://api.github.com/users/alexksikes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexksikes/subscriptions","organizations_url":"https://api.github.com/users/alexksikes/orgs","repos_url":"https://api.github.com/users/alexksikes/repos","events_url":"https://api.github.com/users/alexksikes/events{/privacy}","received_events_url":"https://api.github.com/users/alexksikes/received_events","type":"User","site_admin":false},"body":"Yes I was wondering, should we be consistent across all queries? Here RegexpQueryBuilder takes a String, all that was changed is the name of the variable from rexgexp to value.","created_at":"2015-07-02T15:57:32Z","updated_at":"2015-07-02T15:57:32Z","html_url":"https://github.com/elastic/elasticsearch/pull/11896#discussion_r33792815","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/11896","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/33792815"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/11896#discussion_r33792815"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/11896"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/11896","id":38677850,"html_url":"https://github.com/elastic/elasticsearch/pull/11896","diff_url":"https://github.com/elastic/elasticsearch/pull/11896.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/11896.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/11896","number":11896,"state":"open","locked":false,"title":"Refactoring of RegexpQuery","user":{"login":"alexksikes","id":43475,"avatar_url":"https://avatars.githubusercontent.com/u/43475?v=3","gravatar_id":"","url":"https://api.github.com/users/alexksikes","html_url":"https://github.com/alexksikes","followers_url":"https://api.github.com/users/alexksikes/followers","following_url":"https://api.github.com/users/alexksikes/following{/other_user}","gists_url":"https://api.github.com/users/alexksikes/gists{/gist_id}","starred_url":"https://api.github.com/users/alexksikes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexksikes/subscriptions","organizations_url":"https://api.github.com/users/alexksikes/orgs","repos_url":"https://api.github.com/users/alexksikes/repos","events_url":"https://api.github.com/users/alexksikes/events{/privacy}","received_events_url":"https://api.github.com/users/alexksikes/received_events","type":"User","site_admin":false},"body":"Relates to #10217\r\n\r\nThis PR is against the query-refactoring branch.","created_at":"2015-06-26T18:44:39Z","updated_at":"2015-07-02T15:57:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5c670a00f9ccde755ac2bac525d7056308a74bb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/11896/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/11896/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/11896/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/ba70a7163335a695d73c1dc68ae1f203447d87d3","head":{"label":"alexksikes:feature/query-refactoring-regexp","ref":"feature/query-refactoring-regexp","sha":"ba70a7163335a695d73c1dc68ae1f203447d87d3","user":{"login":"alexksikes","id":43475,"avatar_url":"https://avatars.githubusercontent.com/u/43475?v=3","gravatar_id":"","url":"https://api.github.com/users/alexksikes","html_url":"https://github.com/alexksikes","followers_url":"https://api.github.com/users/alexksikes/followers","following_url":"https://api.github.com/users/alexksikes/following{/other_user}","gists_url":"https://api.github.com/users/alexksikes/gists{/gist_id}","starred_url":"https://api.github.com/users/alexksikes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexksikes/subscriptions","organizations_url":"https://api.github.com/users/alexksikes/orgs","repos_url":"https://api.github.com/users/alexksikes/repos","events_url":"https://api.github.com/users/alexksikes/events{/privacy}","received_events_url":"https://api.github.com/users/alexksikes/received_events","type":"User","site_admin":false},"repo":{"id":15257781,"name":"elasticsearch","full_name":"alexksikes/elasticsearch","owner":{"login":"alexksikes","id":43475,"avatar_url":"https://avatars.githubusercontent.com/u/43475?v=3","gravatar_id":"","url":"https://api.github.com/users/alexksikes","html_url":"https://github.com/alexksikes","followers_url":"https://api.github.com/users/alexksikes/followers","following_url":"https://api.github.com/users/alexksikes/following{/other_user}","gists_url":"https://api.github.com/users/alexksikes/gists{/gist_id}","starred_url":"https://api.github.com/users/alexksikes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexksikes/subscriptions","organizations_url":"https://api.github.com/users/alexksikes/orgs","repos_url":"https://api.github.com/users/alexksikes/repos","events_url":"https://api.github.com/users/alexksikes/events{/privacy}","received_events_url":"https://api.github.com/users/alexksikes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexksikes/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/alexksikes/elasticsearch","forks_url":"https://api.github.com/repos/alexksikes/elasticsearch/forks","keys_url":"https://api.github.com/repos/alexksikes/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexksikes/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexksikes/elasticsearch/teams","hooks_url":"https://api.github.com/repos/alexksikes/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/alexksikes/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/alexksikes/elasticsearch/events","assignees_url":"https://api.github.com/repos/alexksikes/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/alexksikes/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/alexksikes/elasticsearch/tags","blobs_url":"https://api.github.com/repos/alexksikes/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexksikes/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexksikes/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexksikes/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexksikes/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/alexksikes/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/alexksikes/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/alexksikes/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/alexksikes/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/alexksikes/elasticsearch/subscription","commits_url":"https://api.github.com/repos/alexksikes/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexksikes/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexksikes/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexksikes/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexksikes/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/alexksikes/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexksikes/elasticsearch/merges","archive_url":"https://api.github.com/repos/alexksikes/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexksikes/elasticsearch/downloads","issues_url":"https://api.github.com/repos/alexksikes/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/alexksikes/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/alexksikes/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/alexksikes/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexksikes/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/alexksikes/elasticsearch/releases{/id}","created_at":"2013-12-17T15:15:49Z","updated_at":"2015-03-10T00:44:52Z","pushed_at":"2015-07-02T00:40:25Z","git_url":"git://github.com/alexksikes/elasticsearch.git","ssh_url":"git@github.com:alexksikes/elasticsearch.git","clone_url":"https://github.com/alexksikes/elasticsearch.git","svn_url":"https://github.com/alexksikes/elasticsearch","homepage":"http://elasticsearch.org","size":121931,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:feature/query-refactoring","ref":"feature/query-refactoring","sha":"4b071f8d2c2bbca6b7067bce502634079c8fada8","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","created_at":"2010-02-08T13:20:56Z","updated_at":"2015-07-02T15:31:22Z","pushed_at":"2015-07-02T15:47:50Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":1901738,"stargazers_count":11845,"watchers_count":11845,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3754,"mirror_url":null,"open_issues_count":1130,"forks":3754,"open_issues":1130,"watchers":11845,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/11896"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/11896"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/11896"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/11896/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/11896/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/11896/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/ba70a7163335a695d73c1dc68ae1f203447d87d3"}}}}