{"action":"created","issue":{"url":"https://api.github.com/repos/fergiemcdowall/search-index/issues/234","repository_url":"https://api.github.com/repos/fergiemcdowall/search-index","labels_url":"https://api.github.com/repos/fergiemcdowall/search-index/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/fergiemcdowall/search-index/issues/234/comments","events_url":"https://api.github.com/repos/fergiemcdowall/search-index/issues/234/events","html_url":"https://github.com/fergiemcdowall/search-index/issues/234","id":132068589,"number":234,"title":"Can't seem to get results when searching for indexed text","user":{"login":"joshterrill","id":5368757,"avatar_url":"https://avatars.githubusercontent.com/u/5368757?v=3","gravatar_id":"","url":"https://api.github.com/users/joshterrill","html_url":"https://github.com/joshterrill","followers_url":"https://api.github.com/users/joshterrill/followers","following_url":"https://api.github.com/users/joshterrill/following{/other_user}","gists_url":"https://api.github.com/users/joshterrill/gists{/gist_id}","starred_url":"https://api.github.com/users/joshterrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshterrill/subscriptions","organizations_url":"https://api.github.com/users/joshterrill/orgs","repos_url":"https://api.github.com/users/joshterrill/repos","events_url":"https://api.github.com/users/joshterrill/events{/privacy}","received_events_url":"https://api.github.com/users/joshterrill/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2016-02-08T07:06:59Z","updated_at":"2016-02-15T10:13:31Z","closed_at":"2016-02-11T21:44:51Z","body":"I'm trying to write something where I can upload a document, grab the text out of the document and store the text (and filename and mimetype) in search-index.\r\n\r\nI've stored a document just fine, but when I go to search through text in it, nothing seems to ever come up.\r\n\r\nSo when I put wildcards (`*`) in both the search fields, I get the document that I have stored in the database:\r\n\r\n```\r\napp.post('/search', function(req, res) {\r\n    var q = {};\r\n    q.query = {\r\n      '*': ['*']\r\n    };\r\n    si.search(q, function (err, searchResults) {\r\n      if (!err) {\r\n        res.json({results: searchResults});\r\n      } else {\r\n        res.json({error: err});\r\n      }\r\n    });\r\n});\r\n```\r\n\r\n![Imgur](http://i.imgur.com/PILI1Ac.png)\r\n\r\nBut when I search for a word that is inside the `text` field, like the word \"traditional\", I get no results:\r\n\r\n```\r\n  app.post('/search', function(req, res) {\r\n    var q = {};\r\n    q.query = {\r\n      '*': ['traditional']\r\n    };\r\n    si.search(q, function (err, searchResults) {\r\n      if (!err) {\r\n        res.json({results: searchResults});\r\n      } else {\r\n        res.json({error: err});\r\n      }\r\n    })\r\n});\r\n```\r\n\r\n![Imgur](http://i.imgur.com/sYJKw4y.png)"},"comment":{"url":"https://api.github.com/repos/fergiemcdowall/search-index/issues/comments/184145365","html_url":"https://github.com/fergiemcdowall/search-index/issues/234#issuecomment-184145365","issue_url":"https://api.github.com/repos/fergiemcdowall/search-index/issues/234","id":184145365,"user":{"login":"eklem","id":236656,"avatar_url":"https://avatars.githubusercontent.com/u/236656?v=3","gravatar_id":"","url":"https://api.github.com/users/eklem","html_url":"https://github.com/eklem","followers_url":"https://api.github.com/users/eklem/followers","following_url":"https://api.github.com/users/eklem/following{/other_user}","gists_url":"https://api.github.com/users/eklem/gists{/gist_id}","starred_url":"https://api.github.com/users/eklem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eklem/subscriptions","organizations_url":"https://api.github.com/users/eklem/orgs","repos_url":"https://api.github.com/users/eklem/repos","events_url":"https://api.github.com/users/eklem/events{/privacy}","received_events_url":"https://api.github.com/users/eklem/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T10:13:30Z","updated_at":"2016-02-15T10:13:30Z","body":"Just saw a possible error in your siOptions, @joshterrill. Not sure if your `nGramLength` definition will work. I figured this out the hard way a while ago, but got it working, [defining multiple nGramLength's as an array](https://github.com/fergiemcdowall/search-index/blob/87df5e5a82ba3e68cace586a4c246a293add87fa/doc/add.md#ngramlength):\r\n```\r\n{\r\n  ...\r\n  nGramLength: [1, 2, 3],\r\n  ...\r\n}\r\n```\r\n\r\n"}}