apache / apachecon-acasia

Community Over Code Asia - Asia edition of the flagship ASF conference
https://asia.communityovercode.org
20 stars 59 forks source link

Create the search page of speaker #85

Open WillemJiang opened 3 years ago

WillemJiang commented 3 years ago

As we already have some speaker‘s with picture, It is more easier for us to search the speaker information with track.

lqq-tj commented 3 years ago

There are three problems about the search function:

1. Does the search function use a third party search engine

2. Using Hugo's static search, the effect may be very poor

3. Chinese word segmentation exists in Chinese retrieval

Solution: the search cases provided by Hugo official website are recommended as follows:

1、hugo-elasticsearch. Generate Elasticsearch indexes for Hugo static sites by parsing front matter

2、hugo-lunr-zh. A bit like Hugo-lunr, but Hugo-lunr-zh can help you separate the Chinese keywords.

      hugo-lunr. A simple way to add site search to your static Hugo site using lunr.js. Hugo-lunr will create an index file of any html and markdown documents in your Hugo project.
lqq-tj commented 3 years ago

When further analyzing the source code of Hugo, I found that when Hugo generates a static website, it will automatically generate an index.xml file in the root directory, and when Hugo uses Chinese and English dual modes, it will generate the corresponding zh / index.xml and index.xml files in Chinese and English. In this XML file, the subject, time and Conference introduction and conference link, so that we can take this XML file as the search index library. Moreover, because of the characteristics of XML file, it will perfectly solve the above three problems, and can support Chinese retrieval without NPM, grunt or other construction tools while ensuring the maximum search efficiency.