Thinking-Sphinx在控制台或通过Web应用程序未返回任何结果 [英] Thinking-Sphinx not returning any results in console or via web app

查看:96
本文介绍了Thinking-Sphinx在控制台或通过Web应用程序未返回任何结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似于这些: sphinx-not-indexing ,< a href = https://stackoverflow.com/questions/10091367/thinkingsphinx-returning-empty-result-in-console> thinking-sphinx在控制台中返回空结果,在这里类似

问题描述是这样的:我无法得到Sphinx带有任何参数的任何结果。我有一个HDD支架,当我尝试使用Sphinx在Rails控制台中执行搜索时,我得到了[],即使我知道数据库中有项目也是如此。如果我执行Hdd.search(),我应该得到与Hdd.all相同的东西,但是我却得到了[]。我看到了一篇有关Hdd.search()。to_a的帖子,但这对我没有影响,我为零。对于其他人来说,他们有时在网页上获得的结果与在Rails控制台上获得的结果有所不同,但对我而言并非如此。我的网站还具有搜索功能,它也可以生成[]。

The problem description is this: I can't get any results with any parameters from Sphinx. I have a hdd scaffold, and when I try and perform a search in rails console with sphinx I get [], and that's even when I know that there are items in the database. If I do Hdd.search() I should get the same as Hdd.all, but instead I get []. I saw a post about doing Hdd.search().to_a, but that doesn't make a difference for me, I get nil. For others it seems that they sometimes get different results on their webpage than their rails console, but it isn't this way for me. My site also has search functionality and it produces [] as well.

关于它的有趣之处在于,从上次工作到现在,我所做的一切它的失败之处在于添加了一些小的修改,即更改了模型和视图,进行了一些迁移,并安装了一个新的插件,carrierwave。现在,在所有这些之间,搜索似乎无法正常工作。我重新启动,重新构建,重新编排思想狮身人面像,但无济于事。我也重新启动了服务器,甚至将其运行在webrick而不是apache下,但是问题基本上仍然相同。

Funny part about it is, all I've done between the time it was last working and now that it's failing is add some small modifications-namely change the model and view, make a few migrations, and install a new plugin, carrierwave. Now, it seems like between all of that, search just isn't working. I've restarted, rebuilt, reindexed thinking sphinx, but to no avail. I've also restarted the server too, and even ran it under webrick instead of apache, but the problem has essentially remained the same.

输出:

rake ts:rebuild

rake ts:rebuild

using config file '/home/adam/RailsForensicsHardDriveApp/ForensicsHDD/config/development.sphinx.conf'...
indexing index 'hdd_core'...
collected 6 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 6 docs, 292 bytes
total 0.006 sec, 47510 bytes/sec, 976.24 docs/sec
indexing index 'hdd_delta'...
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.003 sec, 0 bytes/sec, 0.00 docs/sec
skipping non-plain index 'hdd'...
total 4 reads, 0.000 sec, 3.8 kb/call avg, 0.0 msec/call avg
total 14 writes, 0.000 sec, 2.5 kb/call avg, 0.0 msec/call avg
Started successfully (pid 6700).

我注意到我在上面的^中看到一行,内容为 跳过非平原index'hdd'...

I notice that I get a line in the above ^ that says "skipping non-plain index 'hdd'..."

我不知道那是什么意思,但听起来它没有做应做的事情。

I don't know what that means, but it sounds like it's not doing something that it should.

我尝试使用ruby debug调试功能,但这还没有取得任何成果。我希望别人能从我发布的内容中得到一些建议,对我有帮助。

I have tried to debug the function using ruby debug, but that hasn't born any fruit yet. I'm hoping that somebody else has some advice from what I post that could help me.

我已经运行过rake rails:update
我已经卸载了并在此要点中重新安装了think-sphinx gem

I've run rake rails:update I've uninstalled and reinstalled thinking-sphinx gem

a>我已经包含了相关文件。您可以看到,在模型中,我尝试通过扩展大小来消除级联空间太小的问题,但这也没有任何改变。

In this gist I have included the pertinent files. You can see that in the model, I've tried to eliminate the problem of concatenation space being too small by extending the size, but that hasn't made a difference either.

我已经阅读了 deltas文档和有关设置的常见问题解答向上狮身人面像与乘客(是的,我正在用乘客),我觉得这都不是问题,因为狮身人面像在它神秘地(对我来说)停止正常运行之前运行得很好。

I've read the deltas documentation and the FAQ on setting up sphinx with passenger (yes, I am running rails with passenger) and I don't feel like either of those are the problem because I had sphinx running quite well before it mysteriously (to me) stopped functioning correctly.

不知道为什么它不起作用。我将整个项目都放在git下,并且尝试了在工作时回滚到早期版本,重建索引并执行搜索,但这似乎不起作用。我尝试删除数据库并重新创建它,然后重新迁移,然后重新构建狮身人面像,但这还是行不通的。

I honestly have no idea why it's not working. I have the entire project under git, and I've tried rolling back to earlier versions when it was working, rebuilding the index and performing a search, but that doesn't seem to work. I've tried dropping the database and recreating it, re-migrating, and then rebuilding sphinx, but that hasn't worked either.

推荐答案

跳过非普通索引'hdd'是可以的-这是分布式索引,无法建立索引。
如果您看一下索引器输出

skipping non-plain index 'hdd' is okay - this is distributed index and can't be indexed. If you take a look on indexer output

collected 6 docs, 0.0 MB

这意味着索引中只有六个文档。如果您没有从Sphinx得到任何错误,则可能是您没有与您的搜索相匹配的任何文档。

That means that you only have six documents in the index. If you don't get any errors from Sphinx it just might be that you don't have any documents that matches your search.

这篇关于Thinking-Sphinx在控制台或通过Web应用程序未返回任何结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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