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

fix(search): restrict search field to names only #558

Merged
merged 4 commits into from
May 26, 2024

Conversation

everpcpc
Copy link
Contributor

No description provided.

@trim21
Copy link
Contributor

trim21 commented May 14, 2024

NameCN就是中文名

@everpcpc
Copy link
Contributor Author

咦,那有点奇怪,现在好多条目即使是用完整的中文全称都搜不到的样子

@trim21
Copy link
Contributor

trim21 commented May 14, 2024

可能是权重有点问题

@everpcpc everpcpc marked this pull request as draft May 14, 2024 18:00
@trim21
Copy link
Contributor

trim21 commented May 14, 2024

理论上来说nameCn就是主站显示的中文名

@trim21
Copy link
Contributor

trim21 commented May 14, 2024

可以考虑降低别名的权重,提高原标题和中文标题的权重

@everpcpc
Copy link
Contributor Author

summary 现在看起来还是有点喧宾夺主,我看之前貌似是拿掉了的,但是没有生效的样子?

@everpcpc
Copy link
Contributor Author

比如这个条目 https://bgm.tv/subject/264093 ,用日文全名搜索出来是第一个,但是中文全名就完全搜不到

@everpcpc
Copy link
Contributor Author

前面定义的 searchAbleAttribute 好像只有在第一次 create index 的时候才能生效?不如这里直接只 search names 就好了,其他的字段都只需要 filter.

@everpcpc everpcpc marked this pull request as ready for review May 26, 2024 01:15
@everpcpc everpcpc changed the title fix(search): extract more subject names from wiki fix(search): restrict search field to names only May 26, 2024
@@ -169,6 +168,9 @@ func (c *client) doSearch(
}

raw, err := c.subjectIndex.SearchRaw(words, &meilisearch.SearchRequest{
AttributesToSearchOn: []string{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果这样的话就要改一下search able fields吧?没必要索引简洁了

@trim21
Copy link
Contributor

trim21 commented May 26, 2024

前面定义的 searchAbleAttribute 好像只有在第一次 create index 的时候才能生效?不如这里直接只 search names 就好了,其他的字段都只需要 filter.

这个选项改了之后我会重建的

@trim21
Copy link
Contributor

trim21 commented May 26, 2024

这样一来tag还能搜索吗

@everpcpc
Copy link
Contributor Author

everpcpc commented May 26, 2024

应该不需要搜 tag?毕竟已经拿来 filter 了(而且其实现在 tag 里本身有效信息也比较少

@trim21
Copy link
Contributor

trim21 commented May 26, 2024

Tag []string `json:"tag"` // and
这里是支持tag搜索的

@everpcpc
Copy link
Contributor Author

这个应该是 filter 不是 search?

@trim21
Copy link
Contributor

trim21 commented May 26, 2024

确实

@trim21 trim21 merged commit cedf850 into bangumi:master May 26, 2024
5 of 6 checks passed
@everpcpc everpcpc deleted the fix-search branch May 26, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants