B
B
Boris2012-03-22 12:37:10
SQL
Boris, 2012-03-22 12:37:10

Autocompletion of strings from a very large database. Search by string?

An interesting article about FIAS appeared on Habré the other day .
On fias.nalog.ru there is an example of a form with a search for all addresses.
The simplest example of implementing a street-only search is obvious: "SELECT * FROM street WHERE name LIKE '?%'" (with an index on this very name, which will only be used if we search for the pattern '?%').
And what are the more efficient and productive solutions? Lucene? Sphinx?
If it doesn't make it difficult, poke your finger, what to read.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
slang, 2012-03-22
@slang

I did this on Sphinx, yes, very quickly, and I advise him.

N
nutz, 2012-03-22
@nutz

Indeed, an engine tuned for such tasks will work much faster here. I only came across Sphinx, so if it is possible to install software on the server (as well as start services), then I think it's worth looking in his direction. Installing and configuring is a matter of one day. And in the future, you can strain it for some other services of the site.

E
egorinsk, 2012-03-23
@egorinsk

And what is unproductive in LIKE something%? The index is used.

P
Puma Thailand, 2012-03-24
@opium

The first thing that comes to mind is indexes for likes as a whole work
Recently I made a large system on sphinx, about 16 million records, it pulls about 100 requests per second fulltextserch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question