next-theme / hexo-generator-searchdb

🔍 Seach data generator plugin for Hexo.
https://www.npmjs.com/package/hexo-generator-searchdb
MIT License
63 stars 5 forks source link

Results of `search.xml` are significantly less than `search.json`'s in NexT search #37

Open pilgrimlyieu opened 3 months ago

pilgrimlyieu commented 3 months ago

I used to set path: search.xml as written in the README. However I've been bothered by the search because I can't find some pages in the search results.

When I checked search.xml, I could find the key words and target pages not included in the search result. Then I changed search.xml to search.json and these pages are listed in the result.

So I'm wondering if there's something wrong with the search database of XML format.

I have a large number of posts and pages so please forgive me for not giving example to reproduce this issue. But I think you can have a try changing search.xml to search.json to see if there's difference.

pilgrimlyieu commented 3 months ago

Here're two searching examples.

XML

xml-1 xml-2

JSON

json-1 json-2


The key word is included in search.xml but not listed in the result.

xml-db xml

JSON result

json

TrumanDu commented 1 month ago

这个问题是文章内容存在特殊字符,xml无法解析正确,建议使用json. 我感觉xml对字符兼容性有点差。 @stevenjoezhang 建议文档修改默认值为json

The problem is that there are special characters in the content of the article, and the XML cannot be parsed correctly. It is recommended to use json. I feel that XML has poor character compatibility. @Stevenjoezhang Suggested document modification Default value is json