在开发服务器上设置 Sphinx?
我们正在尝试让 Sphinx 在所有三个数据库中为我们的所有三个服务器(开发、登台和实时)建立索引,将它们分别放入单独的索引中进行测试等。
我的问题是:我们如何在 Codeingniter (PHP) 中设置查询)所以登台和开发服务器调用正确的索引?
提前致谢!
We're trying to get Sphinx to index all three of our servers (development, staging and live) across all three databases, putting them each into seperate indexes for testing etc.
My question is: How do we setup the queries in Codeingniter (PHP) so the staging and development server make calls to the right index?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为在你的配置文件中有一个常量指示它是哪种类型的安装。例如,使用该常量作为索引名称的前缀,例如 dev_Posts 、 sta_Posts 和 live_Posts .. 这些行中的某些内容。因此,您根据该模式创建索引,只需更改常量以反映您想要使用的索引。只是我的2分钱。
i think in your config file have a constant which indicates which type of install it is. For instance and use that constant prefixed to your index names, for instance dev_Posts , sta_Posts and live_Posts .. something on those lines. So you create your indexes as per that pattern and just change the constant to reflect which index you want used. Just my 2 cents.
您可以在sphinx api的第二个参数中指定您想要的索引 查询方法。
You can specify index that you want in second parameter of sphinx api query method.