干草堆:多个型号的一个searchIndex [英] Haystack: one searchIndex for multiple models

查看:101
本文介绍了干草堆:多个型号的一个searchIndex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Haystack的入门页面中,它描述了可能性对于多种型号使用一个SearchIndex:

On the getting started page of Haystack, it describes the possibility of using one SearchIndex for multple models:


您通常为
希望索引的每种类型的模型创建一个唯一的SearchIndex,虽然您可以在
不同的模型之间重复使用相同的SearchIndex,如果您这样做,并且您的字段名称是
非常标准化。

You generally create a unique SearchIndex for each type of Model you wish to index, though you can reuse the same SearchIndex between different models if you take care in doing so and your field names are very standardized.

然而,我还没有找到任何关于如何这样做的信息。其背后的原因是,一些Heroku搜索引擎应用程序提供有限的索引,所以我认为保持索引数量是一个好主意。我应该怎么做?

However I haven't found any information regarding how to do so. The reasoning behind it is that a few Heroku search engine apps provide limited amount of indices, so I think it's a good idea to keep the number of indices slim. How should I do it?

推荐答案

索引号不会是唯一的,除非你在setting.py中指定.Multiple search_index.py文件不意味着多个索引。

No of index will be one only unless you specify in setting.py .Multiple search_index.py files doesnot mean that multiple indexes.

这篇关于干草堆:多个型号的一个searchIndex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆