{"action":"closed","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/9862","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/9862/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/9862/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/9862/events","html_url":"https://github.com/elastic/elasticsearch/issues/9862","id":58823477,"number":9862,"title":"multi_match cross_fields type does not work with position_offset_gap setting (!?)","user":{"login":"dezsenyi","id":7630338,"avatar_url":"https://avatars.githubusercontent.com/u/7630338?v=3","gravatar_id":"","url":"https://api.github.com/users/dezsenyi","html_url":"https://github.com/dezsenyi","followers_url":"https://api.github.com/users/dezsenyi/followers","following_url":"https://api.github.com/users/dezsenyi/following{/other_user}","gists_url":"https://api.github.com/users/dezsenyi/gists{/gist_id}","starred_url":"https://api.github.com/users/dezsenyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dezsenyi/subscriptions","organizations_url":"https://api.github.com/users/dezsenyi/orgs","repos_url":"https://api.github.com/users/dezsenyi/repos","events_url":"https://api.github.com/users/dezsenyi/events{/privacy}","received_events_url":"https://api.github.com/users/dezsenyi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Query%20DSL","name":":Query DSL","color":"009800"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/adoptme","name":"adoptme","color":"207de5"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/bug","name":"bug","color":"9e2c2c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-24T23:25:29Z","updated_at":"2015-12-05T17:52:14Z","closed_at":"2015-12-05T17:52:14Z","body":"Hi,\r\n\r\nIt seems that the __cross_fields__ type __multi_match__ query cannot work together with fields that have __position_offset_gap__ settings.\r\nIs this a feature or bug?\r\n\r\nReproduction:\r\n\r\n```\r\n# Delete old index\r\ncurl -XDELETE \"http://localhost:9200/testindex\"\r\n\r\n# Create test index\r\ncurl -XPOST \"http://localhost:9200/testindex/\" -d'\r\n{\r\n  \"index\": {\r\n    \"number_of_replicas\": \"0\",\r\n    \"number_of_shards\": \"1\"\r\n  }\r\n}'\r\n\r\n# (testcase 1) Create mapping with position offset gap\r\ncurl -XPUT \"http://localhost:9200/testindex/_mapping/user\" -d'\r\n{\r\n  \"user\": {\r\n    \"properties\": {\r\n      \"first_name\": {\r\n        \"type\": \"string\",\r\n        \"position_offset_gap\": 100\r\n      },\r\n      \"last_name\": {\r\n        \"type\": \"string\",\r\n        \"position_offset_gap\": 100\r\n      }\r\n    }\r\n  }\r\n}'\r\n\r\n# (testcase 2) Create mapping without position offset gap\r\ncurl -XPUT \"http://localhost:9200/testindex/_mapping/user\" -d'\r\n{\r\n  \"user\": {\r\n    \"properties\": {\r\n      \"first_name\": {\r\n        \"type\": \"string\"\r\n      },\r\n      \"last_name\": {\r\n        \"type\": \"string\"\r\n      }\r\n    }\r\n  }\r\n}'\r\n\r\n# Put 1 user\r\ncurl -XPUT \"http://localhost:9200/testindex/user/1\" -d'\r\n{\r\n  \"first_name\": \"John\",\r\n  \"last_name\": \"Smith\"\r\n}'\r\n\r\n# Multi match with cross_fields (try with testcase 1 and 2)\r\ncurl -XGET \"http://localhost:9200/testindex/user/_search\" -d'\r\n{\r\n  \"query\": {\r\n    \"multi_match\": {\r\n      \"query\": \"John Smith\",\r\n      \"type\": \"cross_fields\",\r\n      \"fields\": [\r\n        \"first_name\",\r\n        \"last_name\"\r\n      ],\r\n      \"operator\": \"and\"\r\n    }\r\n  }\r\n}'\r\n```\r\n\r\nTry it with the first and then with the second mapping, as well. \r\nTestcase 1 will not produce result hit, while testcase 2 will get the 1 document.\r\nI tried with the latest ES version.\r\n\r\nThanks,\r\nCsaba D.\r\n"}}