N
N
Neka_D2017-03-01 19:50:33
PostgreSQL
Neka_D, 2017-03-01 19:50:33

How to find string match without word order in postgresql?

There is a hierarchical table of addresses (simple adjacency list). You just need to do an address search for an unnormalized user request. For example, there are such records in the table
Russia, "Russia" (country)
| - Perm, "Russia Perm" (city)
| - Altaiskaya, "Russia Perm Altai" (street)
| - 25, "Russia Perm Altai 25" (number at home)
Here, the "name" field begins, and at the end, in brackets, the type of the address unit. A quoted denormalized string of all the names of the parent tree, this can be an array of names - it doesn't matter the DB at design time. It is necessary that the word order does not affect the selection, i.e. request "perm 25 altai"
Full-text search here is extremely redundant - there are no dictionaries as such, the whole table is a dictionary, and for each entry the dictionary will be a denormalized address.
Point me on the right path, please, I couldn’t even google it, for the most part people are interested in full-text search, but that’s not it.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question