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

能否提供一个类似segmentfault的多表搜索思路? #84

Open
mrdznet opened this Issue Apr 8, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@mrdznet
Copy link

mrdznet commented Apr 8, 2019

segmentfault这些搜索应该不是一个表:全部 、 问答、文章、头条、讲堂、标签、用户、活动
我先在有一个思路,就是建立一个通用模型:如id、title、body、type,然后把这些集合合并到这个通用模
。比如

新闻:
id:N_123(N前缀+数据自增)
title:文章标题
body:正文内容
type:1

======

问答:
id:Q_123(Q前缀+数据自增)
title:问答标题
body:提问内容
type:2

======

会员:
id:U_123(U前缀+数据自增)
title:会员名称
body:无
type:3

等等。。。。这样就可以通过type来分开搜索出每个结果。
当然还可以整合一些其他的特殊字段,在前端显示的时候根据不同的type来显示

不知道还有没有其他思路?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.