-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TNTSearch returns no results for partial queries. #15
Comments
The demo page uses the search not the searchBoolean method, so try with: $tnt->asYouType = true;
$result = $tnt->search($request->input('query'), 10); Does this solve your issue? |
Thank you, it did. I've just realized that I tried |
Great! Can you share some performance data, how long does the indexing take and how fast are the result queries? I'm just eager to know how it works on uses cases other than mine :) |
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. |
Ok, great. Oh yeah, and don't forget to order the results correctly. Something like: $airports = Airport::whereIn('id', $result['ids'])->orderByRaw("FIELD (ID, $result['ids'])")->get(); because mysql doesn't keep the order when you use And don't forget to star the package ;) |
I'm running into a similar issue and am wondering if you could offer some advice. I have two rows in my db that are getting indexed, with column values
When I search for 'propyl' I only get the first result. When I search for 'propylp' I get the second result. I looked at the query being executed when
If I modify the query slightly I see this, which looks like each is being treated as a separate word with 1 hit only:
Is there something that could be happening when building the index that omits the 'propylparaben' hit from the 'propyl' wordlist since there is a space immediately following 'propyl'? Thanks! |
The words If you think you'll have a small dataset and won't run into performance problems, you can query the index wordlist table directly |
Thanks for your response. I managed to come up with a solution that involves overriding several of the methods in TNTSearch.php. Is there a cleaner way to do this through the existing API? |
* commit '4a992f620049380e6133f9c2a0d9a1d04bab84ff': Changed popmaterial-bulkorder@dfd.de password and server
Hello,
I 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?
I'm indexing city names like so:
And here's my controller:
In case you'll have time to test it yourself, here's a Laravel migration file, and here's a CSV file with data.
The text was updated successfully, but these errors were encountered: