How to write an automatic search query in python?

How to write automatic search for sentences using python, mysql and jquery? Are there any relevant teaching aids. Because Googling just gave me some results for PHP, but not something related to Python.

+3
source share
2 answers

There is a good jQuery plugin for this, http://docs.jquery.com/Plugins/autocomplete . To use your data with it, you need to write a controller in python that returns autocomplete data as a JSON structure.

You also need to choose a good structure for writing the actual controller, check this question for some good suggestions: Recommendations of the Python REST (web services) framework?

+2
source

Autofill, as a rule, is carried out similarly to spell checking. Here's an article from Nick Blog about Levenshtein Autonomus . It is written in python so you can follow. I said earlier because until this checks the spellchecker and suggests similar names, she will not be able to anticipate where popular queries are being made. To do this, a naive approach would be a binary search tree tree , in which you weighted the nodes based on the popularity of their search.

+2
source

Source: https://habr.com/ru/post/1786107/


All Articles