Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

咨询检索配置(缓存值: "多大的;多少平" 使用:search("是多少平的") 没有返回结果,想要可以返回应该怎么做呢) #443

Open
LvHuaiSheng opened this issue Jun 13, 2024 · 2 comments

Comments

@LvHuaiSheng
Copy link

缓存值: "多大的;多少平" 使用:search("是多少平的") 没有返回结果,想要可以返回应该怎么做呢,具体代码如下?
this.flexSearch = new FlexSearch.Document({
tokenize: "full",
depth: 3,
cache: true,
async: false,
doc: {
id: 'id',
index: ['question'] // value = "多大的;多少平" 使用:search("是多少平的") 没有返回结果,想要可以返回应该怎么做呢?
}
});

@demonskp
Copy link

你可以尝试对你的搜索词,进行下分词。用jieba这个库把中文“是多少平的”,分成["是", "多少平", "的"]然后去每个搜索

@ts-thomas
Copy link
Contributor

Please use this version: https://github.com/nextapps-de/flexsearch/tree/v0.8-preview

const Index = FlexSearch.Index;
const Charset = FlexSearch.Charset.CjkDefault; // CJK

index.add(1 , "多大的;多少平");

const result = index.search('是多少平的', { suggest: true });

Since from the query was not indexed you'll need to enable suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants