【Baidu cloud search, search all kinds of information :http://www.lqkweb.com】
【Search the net disk, search all kinds of information :http://www.swpan.cn】

In Section 371, ElasticSearch, a Python search engine that uses Django to search what’s popular and what’s scraping

I search simple principle We can use js to realize, first of all use js to get to the input search term Set in an array to store search word, whether in the search term in the array exists if there is to delete the original word, to put new words in the front of the array If there is no direct the front can put new words in the array, then the circular array according to the result

Hot search implementation principle, when the user searches for a word, can be saved to the database, and then record the search times, the use of Redis cache search times to the most to the word, after a period of time to update the cache

Note: open source projects Django combining Scrapy can learn Django – dynamic – scraper https://github.com/holgerd77/…

supplement

– The default Elasticsearch can only search 10,000 pieces of data, it will return an error ** when it is larger

Set the method

Step one:

Open the index library address of the project and close the index first. Otherwise, the second step of setup operation cannot commit

Step 2:

Open the composite query, enter the following information, remember to choose PUT mode to submit, credit_trace_data to this index library index, max_result_window set to 2 billion, this value is integer type, cannot be infinite

http://127.0.0.1:9200/    PUT

credit_trace_data/_settings? preserve_existing=true

 {

  “max_result_window” : “2000000000”

 }

Finally, click Submit Application. If the configuration is correct, the right window will display the following information

If you want to query MAX_RESULT_WINDOW, you simply need to change PUT to GET

Finally, remember to turn on the index!