wzpan / hexo-generator-search

A plugin to generate search data for Hexo.
MIT License
468 stars 86 forks source link

Specify a tag or skip some articles when indexing #49

Closed darkduckgo closed 5 years ago

darkduckgo commented 5 years ago

Firstly, thanks for providing json format instead of xml, which reduces the 3MB search file to 1MB+.

But every time the browser loads an MB file, it will deeply affect the loading speed of the search bar.After I checked search.json file ,I found it seems to read the encrypted article that the search.xml will not read before. and that makes it load a lot of very long code snippets or articles, as well as private articles.

So can I write a simple logical judgment, like if there is an encrypt in the meta, and then skip the content entry of this part of the article?

THX~

wzpan commented 5 years ago

Sounds reasonable. I think we probrably can add a new article front-matter like indexing (by deauflt is true) to decide wether it’s to be indexed in the search content.

wzpan commented 5 years ago

@imbadark done. Now you can add indexing: false to your post meta to exclude indexing.

darkduckgo commented 5 years ago

@imbadark done. Now you can add indexing: false to your post meta to exclude indexing.

Good job. Thanks a lot , I will feedback if I find anything unusual.

cnrting commented 5 years ago

@wzpan what if i just want to index title and description except for content for single post? any solution?