【发布时间】:2014-09-08 08:39:23
【问题描述】:
我有这种情况:
{"product": {"name": "Name of Product",
"categories": [{'name': 'Category 1'}, {'name': 'Category' 2}]}
这是我的 solr 文档的结构简历。当我要搜索时,我总是会搜索产品名称和类别。但是,如果我搜索这个产品和category = 'Category 1',我应该返回一个像这样的json:
{"product": {"name": "Name of Product",
"categories": {'name': 'Category 1'}}
我不知道最好的方法。目前,我的选择是:
- 在代码中制作这个最终结构;
- 在 Solr、Product 和 Category 中创建两个集合,并模拟连接以安装此最终响应。
我是 Solr 的新手,所以我有点困惑。
顺便说一句,我在我的 Flask 应用程序中使用 sunburnt。
【问题讨论】: