{"action":"created","issue":{"url":"https://api.github.com/repos/cult-of-coders/grapher/issues/164","repository_url":"https://api.github.com/repos/cult-of-coders/grapher","labels_url":"https://api.github.com/repos/cult-of-coders/grapher/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/cult-of-coders/grapher/issues/164/comments","events_url":"https://api.github.com/repos/cult-of-coders/grapher/issues/164/events","html_url":"https://github.com/cult-of-coders/grapher/pull/164","id":240203582,"number":164,"title":"Text search","user":{"login":"Herteby","id":6474685,"avatar_url":"https://avatars2.githubusercontent.com/u/6474685?v=4","gravatar_id":"","url":"https://api.github.com/users/Herteby","html_url":"https://github.com/Herteby","followers_url":"https://api.github.com/users/Herteby/followers","following_url":"https://api.github.com/users/Herteby/following{/other_user}","gists_url":"https://api.github.com/users/Herteby/gists{/gist_id}","starred_url":"https://api.github.com/users/Herteby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Herteby/subscriptions","organizations_url":"https://api.github.com/users/Herteby/orgs","repos_url":"https://api.github.com/users/Herteby/repos","events_url":"https://api.github.com/users/Herteby/events{/privacy}","received_events_url":"https://api.github.com/users/Herteby/received_events","type":"User","site_admin":false},"labels":[{"id":442503952,"url":"https://api.github.com/repos/cult-of-coders/grapher/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-03T15:21:03Z","updated_at":"2017-08-19T12:06:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cult-of-coders/grapher/pulls/164","html_url":"https://github.com/cult-of-coders/grapher/pull/164","diff_url":"https://github.com/cult-of-coders/grapher/pull/164.diff","patch_url":"https://github.com/cult-of-coders/grapher/pull/164.patch"},"body":"First draft.\r\n\r\nThe way I got around not knowing what the text index looks like on the client is by adding a $fields property to $text, where you specify which fields to search on the client. These should of course be the same as the index you set up on the server.\r\n\r\nYou can now do text searches like this:\r\n```js\r\n$filters:{\r\n    $text: {\r\n        $search: 'asdasd',\r\n        $fields: ['username', 'profile.first_name', 'profile.last_name']\r\n    }\r\n}\r\n```\r\n\r\nMaybe a more convenient solution could be something like:\r\nCreate `Mongo.Collection.prototype.textIndex()`, which you call on both the client and server. On the server it calls _ensureIndex, and on the client it saves the fields on the collection, so that they can be used by the conversion function.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/cult-of-coders/grapher/issues/comments/323519269","html_url":"https://github.com/cult-of-coders/grapher/pull/164#issuecomment-323519269","issue_url":"https://api.github.com/repos/cult-of-coders/grapher/issues/164","id":323519269,"user":{"login":"Herteby","id":6474685,"avatar_url":"https://avatars2.githubusercontent.com/u/6474685?v=4","gravatar_id":"","url":"https://api.github.com/users/Herteby","html_url":"https://github.com/Herteby","followers_url":"https://api.github.com/users/Herteby/followers","following_url":"https://api.github.com/users/Herteby/following{/other_user}","gists_url":"https://api.github.com/users/Herteby/gists{/gist_id}","starred_url":"https://api.github.com/users/Herteby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Herteby/subscriptions","organizations_url":"https://api.github.com/users/Herteby/orgs","repos_url":"https://api.github.com/users/Herteby/repos","events_url":"https://api.github.com/users/Herteby/events{/privacy}","received_events_url":"https://api.github.com/users/Herteby/received_events","type":"User","site_admin":false},"created_at":"2017-08-19T12:06:34Z","updated_at":"2017-08-19T12:06:34Z","body":"I kind of lost interest in this when I realized that $text couldn't do what I wanted it to do. I guess it's intended for fast searches of longer text documents? But I'll try to fix it anyway."}}
{"actor":{"display_login":"Herteby"}}