{"action":"created","issue":{"url":"https://api.github.com/repos/teamtnt/tntsearch/issues/15","repository_url":"https://api.github.com/repos/teamtnt/tntsearch","labels_url":"https://api.github.com/repos/teamtnt/tntsearch/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/teamtnt/tntsearch/issues/15/comments","events_url":"https://api.github.com/repos/teamtnt/tntsearch/issues/15/events","html_url":"https://github.com/teamtnt/tntsearch/issues/15","id":157401892,"number":15,"title":"TNTSearch returns no results for partial queries.","user":{"login":"Banandrew","id":6409354,"avatar_url":"https://avatars.githubusercontent.com/u/6409354?v=3","gravatar_id":"","url":"https://api.github.com/users/Banandrew","html_url":"https://github.com/Banandrew","followers_url":"https://api.github.com/users/Banandrew/followers","following_url":"https://api.github.com/users/Banandrew/following{/other_user}","gists_url":"https://api.github.com/users/Banandrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Banandrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Banandrew/subscriptions","organizations_url":"https://api.github.com/users/Banandrew/orgs","repos_url":"https://api.github.com/users/Banandrew/repos","events_url":"https://api.github.com/users/Banandrew/events{/privacy}","received_events_url":"https://api.github.com/users/Banandrew/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-29T19:40:33Z","updated_at":"2016-05-29T20:05:11Z","closed_at":"2016-05-29T19:57:17Z","body":"Hello,\r\n\r\nI have a list of ~10k airports with additional data in a table. For example, I have a dynamic search input and want to select an airport in Berlin, if I request \"b\", I get one result \"Vernon B. C.\" (a city in the USA), \"be\" gets me only \"Nossi-Be\" (Madagascar), \"ber\"/\"berl\"/\"berli\" — no results, and only full city name \"berlin\" finds and returns 6 Berlin airports. Same goes for every other query. I saw TNTSearch working very differently on the demo page, any ideas on what I might be doing wrong?\r\n\r\nI'm indexing city names like so:\r\n``` PHP\r\n        $tnt = new TNTSearch;\r\n\r\n        // I get \"SQLSTATE[HY000] [14] unable to open database file\"\r\n        // error unless I load a configuration.\r\n        $tnt->loadConfig([\r\n            'driver'    => config('tntsearch.driver'),\r\n            'host'      => config('tntsearch.host'),\r\n            'database'  => config('tntsearch.database'),\r\n            'username'  => config('tntsearch.username'),\r\n            'password'  => config('tntsearch.password'),\r\n            'storage'   => config('tntsearch.storage')\r\n        ]);\r\n\r\n        $indexer = $tnt->createIndex('airports.index');\r\n        $indexer->query('SELECT id, city_name_ru, city_name_en FROM airports;');\r\n        $indexer->run();\r\n```\r\n\r\nAnd here's my controller:\r\n``` PHP\r\n    public function searchCityWithAnAirport(Request $request)\r\n    {\r\n        $tnt = new TNTSearch;\r\n\r\n        $tnt->loadConfig([\r\n            'driver'    => config('tntsearch.driver'),\r\n            'host'      => config('tntsearch.host'),\r\n            'database'  => config('tntsearch.database'),\r\n            'username'  => config('tntsearch.username'),\r\n            'password'  => config('tntsearch.password'),\r\n            'storage'   => config('tntsearch.storage')\r\n        ]);\r\n\r\n        $tnt->selectIndex('airports.index');\r\n        $tnt->asYouType = true;\r\n        $result = $tnt->searchBoolean($request->input('query'), 10);\r\n        \r\n        return $result;\r\n    }\r\n```\r\n\r\nIn case you'll have time to test it yourself, here's a [Laravel migration file](https://dl.dropboxusercontent.com/u/4458274/2016_05_29_160731_create_airports_table.php), and here's a [CSV file with data](https://dl.dropboxusercontent.com/u/4458274/airports.csv)."},"comment":{"url":"https://api.github.com/repos/teamtnt/tntsearch/issues/comments/222379855","html_url":"https://github.com/teamtnt/tntsearch/issues/15#issuecomment-222379855","issue_url":"https://api.github.com/repos/teamtnt/tntsearch/issues/15","id":222379855,"user":{"login":"Banandrew","id":6409354,"avatar_url":"https://avatars.githubusercontent.com/u/6409354?v=3","gravatar_id":"","url":"https://api.github.com/users/Banandrew","html_url":"https://github.com/Banandrew","followers_url":"https://api.github.com/users/Banandrew/followers","following_url":"https://api.github.com/users/Banandrew/following{/other_user}","gists_url":"https://api.github.com/users/Banandrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Banandrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Banandrew/subscriptions","organizations_url":"https://api.github.com/users/Banandrew/orgs","repos_url":"https://api.github.com/users/Banandrew/repos","events_url":"https://api.github.com/users/Banandrew/events{/privacy}","received_events_url":"https://api.github.com/users/Banandrew/received_events","type":"User","site_admin":false},"created_at":"2016-05-29T20:05:11Z","updated_at":"2016-05-29T20:05:11Z","body":"I'm developing it locally on Homestead, so I guess it doesn't matter right now — I'll remember to send you an email or mention here when the project goes live in a couple of months."}}
{"actor":{"display_login":"Banandrew"}}