{"action":"created","issue":{"url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/425","repository_url":"https://api.github.com/repos/matteodem/meteor-easy-search","labels_url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/425/labels{/name}","comments_url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/425/comments","events_url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/425/events","html_url":"https://github.com/matteodem/meteor-easy-search/issues/425","id":128149501,"number":425,"title":"High CPU usage, multiple subscriptions.","user":{"login":"joejeet","id":36263,"avatar_url":"https://avatars.githubusercontent.com/u/36263?v=3","gravatar_id":"","url":"https://api.github.com/users/joejeet","html_url":"https://github.com/joejeet","followers_url":"https://api.github.com/users/joejeet/followers","following_url":"https://api.github.com/users/joejeet/following{/other_user}","gists_url":"https://api.github.com/users/joejeet/gists{/gist_id}","starred_url":"https://api.github.com/users/joejeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joejeet/subscriptions","organizations_url":"https://api.github.com/users/joejeet/orgs","repos_url":"https://api.github.com/users/joejeet/repos","events_url":"https://api.github.com/users/joejeet/events{/privacy}","received_events_url":"https://api.github.com/users/joejeet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matteodem/meteor-easy-search/labels/Project:Core","name":"Project:Core","color":"207de5"},{"url":"https://api.github.com/repos/matteodem/meteor-easy-search/labels/waiting","name":"waiting","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-22T12:42:23Z","updated_at":"2016-02-23T11:28:08Z","closed_at":null,"body":"I've collection which contains around 10,000 documents in it and each documents contains around 30 fields. Search looks from 5 fields. Also, in beforePublish it collects data from other collection which contains around 5k docs in it.\r\n\r\nCurrent setup of search is MongoDb Core engine with setup like.\r\n\r\n    OpportunitiesIndex = new EasySearch.Index({\r\n      engine: new EasySearch.MongoDB({\r\n      beforePublish: function (action, doc) {\r\n          doc.company = Companies.findOne({\"_id\": doc.companyId }, {\r\n                    fields: {\r\n                        slug: 1,\r\n                        name: 1,\r\n                        coverImage: 1\r\n                      }});\r\n\r\n      return doc\r\n    },\r\n    transform: function(doc) {\r\n      doc.location = doc.city;\r\n      return doc;\r\n    },\r\n    props: {},\r\n    sort: function () {\r\n      return [['featured', 'desc'],['createdAt', 'desc']];\r\n    },\r\n    selector: function (searchObject, options, aggregation) {\r\n      var selector = this.defaultConfiguration().selector(searchObject, options, aggregation),\r\n       now = moment();\r\n  \t  selector.expiresAt = {$gte: now._d};\r\n  \t  selector.hidden = false;\r\n\r\n      var filters = options.search.props;\r\n      if (filters.location) {\r\n        selector.city = filters.location;\r\n      }\r\n      return selector;\r\n     }\r\n    }),\r\n     name: 'OpportunitiesIndex',\r\n     collection: Opportunities,\r\n     fields: [ 'name', 'companyName', 'city', 'jobFunctionId', 'employmentType'],\r\n     defaultSearchOptions: {\r\n       limit: 24\r\n     }\r\n    });\r\n\r\n\r\nWith view page:\r\n\r\n    <section class=\"row text-center bottom-buffer\">\r\n     <div class=\"col-md-6 col-md-offset-3\">\r\n      {{> EasySearch.Input index=index attributes=inputAttributes }}\r\n     </div>\r\n    </section>\r\n    {{#EasySearch.IfSearching index=index }}\r\n      <div>Searching...</div>\r\n      <div>{{> spinner }}</div>\r\n    {{/EasySearch.IfSearching }}\r\n    <div class=\"results-wrapper\">\r\n     <section class=\"tiles row\">\r\n      {{#EasySearch.Each index=index }} {{> listingTile }} {{/EasySearch.Each}}\r\n     </section>\r\n    </div>\r\n    {{> EasySearch.LoadMore index=index count=12 attributes=paginationButton}}\r\n    {{#EasySearch.IfNoResults index=index }}\r\n     <div class=\"padded no-results\">\r\n      No results\r\n    </div>\r\n    {{/EasySearch.IfNoResults }}\r\n\r\n\r\nNormal search returns in multiple subscriptions and high CPU usage.\r\n\r\nFollowing is result from Kadira for one search term enter and it return in 30 subscriptions and response time greater than 12sec.\r\n\r\n\r\n![screen shot 2016-01-22 at 12 31 07](https://cloud.githubusercontent.com/assets/36263/12510779/423ed5ca-c104-11e5-8160-1779ec42ab14.png)"},"comment":{"url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/comments/187660829","html_url":"https://github.com/matteodem/meteor-easy-search/issues/425#issuecomment-187660829","issue_url":"https://api.github.com/repos/matteodem/meteor-easy-search/issues/425","id":187660829,"user":{"login":"matteodem","id":1301147,"avatar_url":"https://avatars.githubusercontent.com/u/1301147?v=3","gravatar_id":"","url":"https://api.github.com/users/matteodem","html_url":"https://github.com/matteodem","followers_url":"https://api.github.com/users/matteodem/followers","following_url":"https://api.github.com/users/matteodem/following{/other_user}","gists_url":"https://api.github.com/users/matteodem/gists{/gist_id}","starred_url":"https://api.github.com/users/matteodem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matteodem/subscriptions","organizations_url":"https://api.github.com/users/matteodem/orgs","repos_url":"https://api.github.com/users/matteodem/repos","events_url":"https://api.github.com/users/matteodem/events{/privacy}","received_events_url":"https://api.github.com/users/matteodem/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T11:28:08Z","updated_at":"2016-02-23T11:28:08Z","body":"can you give me a screenshot? also maybe an example doc for me to reproduce."}}