{"action":"created","issue":{"url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/115","labels_url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/115/comments","events_url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/115/events","html_url":"https://github.com/matteodem/meteor-easy-search/issues/115","id":54183406,"number":115,"title":"Why is my ElasticSearch doesn't work ?","user":{"login":"thaisonle94","id":7360679,"avatar_url":"https://avatars.githubusercontent.com/u/7360679?v=3","gravatar_id":"","url":"https://api.github.com/users/thaisonle94","html_url":"https://github.com/thaisonle94","followers_url":"https://api.github.com/users/thaisonle94/followers","following_url":"https://api.github.com/users/thaisonle94/following{/other_user}","gists_url":"https://api.github.com/users/thaisonle94/gists{/gist_id}","starred_url":"https://api.github.com/users/thaisonle94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaisonle94/subscriptions","organizations_url":"https://api.github.com/users/thaisonle94/orgs","repos_url":"https://api.github.com/users/thaisonle94/repos","events_url":"https://api.github.com/users/thaisonle94/events{/privacy}","received_events_url":"https://api.github.com/users/thaisonle94/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matteodem/meteor-easy-search/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-13T11:53:43Z","updated_at":"2015-01-13T19:19:34Z","closed_at":null,"body":"I have used your **meteor-easy-search** package to create a demo project using **elastic-search** for its search feature.\r\nThis is my [git project repo](https://github.com/thaisonle94/meteor-elasticsearch-demo). Before I applied 'elastic-search' to my project, it runs just fine with the following EasySearch settings:  \r\n```javascript\r\nEasySearch.createSearchIndex('index-players', {\r\n    'collection': Players, // instanceof Meteor.Collection\r\n    'field': ['name', 'score', 'category'], // array of fields to be searchable\r\n    'limit': 10,\r\n    'use' : 'mongo-db',\r\n    'convertNumbers': true,\r\n    'sort': function() {\r\n        return { 'score': -1, 'name': -1 };\r\n    }\r\n});\r\n```\r\nBut after I applied 'elastic-search' by following [these instructions](http://matteodem.github.io/meteor-easy-search/docs/elastic-search/), my app cannot search any more. *(and I have already started the ElasticSearch service using `sudo service elasticsearch start`). When I run `curl http://localhost:9200` it does return an object.* This is my current EasySearch settings:  \r\n```javascript\r\n'collection': Players, // instanceof Meteor.Collection\r\n    'field': ['name', 'score', 'category'], // array of fields to be searchable\r\n    'limit': 10,\r\n    'use': 'elastic-search',\r\n    'query': function (searchString) {\r\n        var query = {\r\n            \"fuzzy_like_this\": {\r\n                \"fields\": [\"name\", \"category\"],\r\n                \"like_text\": searchString\r\n            }\r\n        };\r\n        return query;\r\n    },\r\n    'sort': function () {\r\n        return {\r\n            \"score\": {\"order\": \"desc\"}\r\n        };\r\n    }\r\n```\r\nNow when I type in the keywords for searching, it doesn't return anything, and the weird thing is the `Load More` button still show up.  \r\nWhat get me stuck is that I don't get any errors neither on the client browser console nor the server console which *may* help me find the way to fix this. So I hope you can pay a little of your time to take a look at [my project](https://github.com/thaisonle94/meteor-elasticsearch-demo) and help me fixing this problem.\r\nThanks a lot in advanced !"},"comment":{"url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/comments/69802141","html_url":"https://github.com/matteodem/meteor-easy-search/issues/115#issuecomment-69802141","issue_url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/115","id":69802141,"user":{"login":"thaisonle94","id":7360679,"avatar_url":"https://avatars.githubusercontent.com/u/7360679?v=3","gravatar_id":"","url":"https://api.github.com/users/thaisonle94","html_url":"https://github.com/thaisonle94","followers_url":"https://api.github.com/users/thaisonle94/followers","following_url":"https://api.github.com/users/thaisonle94/following{/other_user}","gists_url":"https://api.github.com/users/thaisonle94/gists{/gist_id}","starred_url":"https://api.github.com/users/thaisonle94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaisonle94/subscriptions","organizations_url":"https://api.github.com/users/thaisonle94/orgs","repos_url":"https://api.github.com/users/thaisonle94/repos","events_url":"https://api.github.com/users/thaisonle94/events{/privacy}","received_events_url":"https://api.github.com/users/thaisonle94/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T19:19:34Z","updated_at":"2015-01-13T19:19:34Z","body":"So I removed `score` as a field but the problem still appears. This is the modified code in my **easy-search.js** file:\r\n```javascript\r\nEasySearch.createSearchIndex('index-players', {\r\n    'collection': Players, // instanceof Meteor.Collection\r\n    'field': ['name', 'category'], // array of fields to be searchable\r\n    'limit': 10,\r\n    'use': 'elastic-search',\r\n    'query': function (searchString) {\r\n        var query = {\r\n            \"fuzzy_like_this\": {\r\n                \"fields\": [\"name\", \"category\"],\r\n                \"like_text\": searchString\r\n            }\r\n        };\r\n        return query;\r\n    },\r\n    'sort': function () {\r\n        return {\r\n            \"score\": {\"order\": \"desc\"}\r\n        };\r\n    }\r\n});\r\n```\r\nThe weird thing is that: when I come back to use `'mongo-db'` search engine, the instant feature works just fine. This is the code when I switch to `'mongo-db'`:\r\n```javascript\r\nEasySearch.createSearchIndex('index-players', {\r\n    'collection': Players, // instanceof Meteor.Collection\r\n    'field': ['name', 'category'], // array of fields to be searchable\r\n    'limit': 10,\r\n    'use' : 'mongo-db',\r\n    'sort': function() {\r\n        return { 'score': -1, 'name': -1 };\r\n    }\r\n});\r\n```\r\nI just don't know how the app behaves weirdly when I set `'elastic-search'` as my search engine: When I type in the keywords, it shows: **No results** but the `Load More` button still show up. (You can see this problem when you clone and test [my repo](https://github.com/thaisonle94/meteor-elasticsearch-demo))."}}