Answer the question
In order to leave comments, you need to log in
How to make a quick auto search by name?
In general, there is a database with
full name + rating of the character All full names are not unique, there are many 100% themes, but they are separated by a certain rating.
Fio is stored in 1 column, not three, because it is impossible to clearly answer the question where is the name and where is the surname, different nations are mixed there.
only 30,000 lines.
task: you need to find in real time all users whose first or last name begins with Phyli
Characters such as should return:
Phyli p ivaniv
John phyli sonton
abram ish kali muhamed li san phyli ch
LIKE is ideal for this, but it will work slowly for 30,000 records.
The catch is that this case will be used with JQuery and its "auto-completion"
i.e. query execution speed is important.
In which direction to dig, tell me pliz?
Answer the question
In order to leave comments, you need to log in
Like does not work with indexes in any case. Or use full-text indexes or a search engine like solar, for example.
Okay, thanks, I'll try the standard Mysql Full-Text Index, it's just simpler like it ... I'm not familiar with other search technologies yet.
as I understand it, in the standard full text index, all phrases are divided into words and these words are, as it were, indices, i.e. there, somewhere in the bowels of mysql, the sorting of words is done and the whole thing is competently searched for, as in a library.
those. in fact, you can do a search by occurrence from the initial position of the word, but not in the center of the word, is that right?
those. here we have Dostoevsky, you can search for occurrences: dos , dostoevs , but if we want Evsky , we won’t find it anymore.
And to search for occurrences inside a word, you already need to use powerful engines ...
This is true?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question