laitimes

10 minutes Pure Python build full-text search engine # Code where # Think # results

Author: Big Fish Pond

Link: https://brucedone.com/archives/838

A group friend asked in the group how to quickly build a search engine, and after searching, I saw this

10 minutes Pure Python build full-text search engine # Code where # Think # results

< h1 toutiao-origin="h2" ># code</h1>

Git:https://github.com/asciimoo/searx

The official is very intimate, very convenient is that has provided docker image, basic pull down can be very convenient to use, execute commands

Then you can use it, normally check the status of docker, you can use it normally

<h1 toutiao-origin="h2" ># think</h1>

How, is not very convenient, let's first see how the source code is implemented

10 minutes Pure Python build full-text search engine # Code where # Think # results

We open the code inside, in fact, the essence is to make a large aggregation of the results after the request, as for the data source, we can come from the DB, or the file, we can look at his core code

< h1 toutiao-origin="h2" ># result</h1>

Every response time we have to easily customize the returned data (it can be a network, it can be a database, it can be a file), so let's think further, if we can hack the response result, then we can completely use the data we climbed as the return result. If it is 1024 or the like, you can create your own "hobby" small engine, the code I will not paste, you can play by yourself. Combined with jieba participles, it can be a little more fun.

Read on