{"action":"opened","issue":{"url":"https://api.github.com/repos/apostrophecms/apostrophe-elasticsearch/issues/5","repository_url":"https://api.github.com/repos/apostrophecms/apostrophe-elasticsearch","labels_url":"https://api.github.com/repos/apostrophecms/apostrophe-elasticsearch/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/apostrophecms/apostrophe-elasticsearch/issues/5/comments","events_url":"https://api.github.com/repos/apostrophecms/apostrophe-elasticsearch/issues/5/events","html_url":"https://github.com/apostrophecms/apostrophe-elasticsearch/issues/5","id":361881455,"node_id":"MDU6SXNzdWUzNjE4ODE0NTU=","number":5,"title":"Add analyzer to fields","user":{"login":"tylerpope","id":3324285,"node_id":"MDQ6VXNlcjMzMjQyODU=","avatar_url":"https://avatars1.githubusercontent.com/u/3324285?v=4","gravatar_id":"","url":"https://api.github.com/users/tylerpope","html_url":"https://github.com/tylerpope","followers_url":"https://api.github.com/users/tylerpope/followers","following_url":"https://api.github.com/users/tylerpope/following{/other_user}","gists_url":"https://api.github.com/users/tylerpope/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerpope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerpope/subscriptions","organizations_url":"https://api.github.com/users/tylerpope/orgs","repos_url":"https://api.github.com/users/tylerpope/repos","events_url":"https://api.github.com/users/tylerpope/events{/privacy}","received_events_url":"https://api.github.com/users/tylerpope/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-19T18:52:00Z","updated_at":"2018-09-19T18:52:00Z","closed_at":null,"author_association":"NONE","body":"Hi, first of all, thanks a ton for making this, it's saved me a bunch of time.\r\n\r\nI've created an analyzer for autocomplete that needs to be added to the fields when they're initialized. I saw the fields setting i.e `fieds: ['tags']` etc but what I need to do is add the anaylzer to each of these tags below the type: 'text'.\r\n\r\nI saw the function responsible in your module here:\r\n\r\n```\r\nself.createIndexes = function(callback) {\r\n      const locales = self.getLocales();\r\n      return async.eachSeries(locales, function(locale, callback) {\r\n        const properties = {};\r\n        _.each(self.fields, function(field) {\r\n          properties[field] = {\r\n            type: 'text'\r\n          };\r\n          properties[field + 'ESExact'] = {\r\n            type: 'keyword'\r\n          };\r\n        });\r\n        return self.client.indices.create({\r\n          index: self.getLocaleIndex(locale),\r\n          body: {\r\n            settings: self.getLocaleSettings(locale),\r\n            mappings: {\r\n              aposDoc: {\r\n                properties: properties\r\n              }\r\n            }\r\n          }\r\n        }, callback);\r\n      }, callback);\r\n    };\r\n```\r\nand what I've done for testing purposes is add the anylzer to the module and it appeared to work.\r\n\r\n```\r\n _.each(self.fields, function(field) {\r\n          properties[field] = {\r\n            type: 'text',\r\n            analyzer: 'autocomplete'\r\n          };\r\n          properties[field + 'ESExact'] = {\r\n            type: 'keyword'\r\n          };\r\n        });\r\n```\r\nI'm new to Elastichsearch and this module and I was wondering if I'm doing this right way? Or is there a way to do this that I'm missing."}}
{"actor":{"display_login":"tylerpope"}}