B
B
BarneyGumble2021-07-08 18:32:57
MySQL
BarneyGumble, 2021-07-08 18:32:57

How can I check if a search query matches a country/city?

On the site (Laravel, MySQL), users now enter queries into the search form. I need to check for each request
- is the entered query a country
- is it a city
- or is it something else

? I make a query on the database of cities (~ 2.5 million records), and if there is zero, but I take the user further ... but this waiting time until the system checks the request for compliance with the country / city turns out to be very long. It is necessary to make this time minimal, any ideas how? Maybe there are some external APIs that are either sharpened for geo, or can simply return the essence of the received request?

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