Skip to content

Database search algorithm (PHP/SQL). Initial release.

Latest
Compare
Choose a tag to compare
@ITFlows-ie ITFlows-ie released this 07 Mar 19:45

General information

Smart and fast search algorithm based on PHP. In this case, a database of world cities search using SQL queries is presented. There are some features of the algorithm:

  • Retrieve the 10 most relevant results or similar results if there are no exact matches.
  • The result will be found even if a small error is made in the request or the request is inaccurate.
  • The presence of an array of exception words or service words that will be found last if there are no other results.
  • High search speed. In the country of the hosting provider, the average request speed is 60 - 100 milliseconds. (In this case, there are 43 thousand cities in the database)

The code also comes with a function to create keywords from a string, which is target for search. Having keywords column in DB table makes search more efficient, because:

  • Saves time for processing the target string during the search.
  • Creates the possibility of adding new keywords by which the target string can be found without changing it.
  • Creates the possibility of excluding exception words (or service words).

Search interface implemented using JavaScript, HTML, CSS. This demo is made in a minimalistic but functional design with a convenient mobile version.
The code also provides a JavaScript function for switching between the found results using the cursor.

Working demo

https://www.search-city-info.online/

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy