Closed groe closed 11 years ago
I'm not sure what's happening here - I just added a test for this scenario (see e3d99301b2072aa4724bacef7bdcc317ba47e3cf), and it's working fine on my machine. What version of Sphinx are you using?
I am using Sphinx 2.0.8-id64-release (r3831)
.
Well, that's strange. I will try to come up with a minimal setup to reproduce the issue (with my class/index config).
Btw, Is there any comfortable way to run a extended query directly on sphinx (bypassing thinking-sphinx) in order to isolate the issue? The command-line tool search
seems to work only when no query at is passed (i.e. listing all records) - the sphinx forums say it's broken.
I usually connect via the mysql CLI tool: mysql --host 127.0.0.1 --port 9306
(the host option is usually required, otherwise it defaults to connecting via a Unix socket instead, ignoring the port option).
Also: just updated to 2.0.8 on my machine (was using 2.0.6), but there's no difference - test still passes. Even a simple test app would be great, if you have the time.
Thanks for your hint on the mysql client - I did not know sphinx is compatible to that, nice!
I have built a test app to reproduce the issue and noticed that it is related to my thinking-sphinx config. Without a config file config/thinking_sphinx.yml
everything works as expected. When I add my config file with ngram-settings to the mix, the problem occurs.
Steps to reproduce the issue with the test app:
git clone https://github.com/groe/ts553.git
mysql -u root -p < db_setup.sql # create mysql DB and grant privileges
rake db:schema:load
rake db:seed
rake ts:rebuild
rake ts553:test
The result is:
All articles: 5
All books: 5
All articles & books: 0
Now remove the config file config/thinking_sphinx.yml
or remove/comment both of the ngram-settings. After that (and doing a rake ts:rebuild
), everything works as expected:
All articles: 5
All books: 5
All articles & books: 10
These ngram-settings have been working with thinking-sphinx 2. Are they still supported in version 3?
Let me know if I can provide you with any further information. Your help is highly appreciated!
I'm not super familiar with ngram settings, but I don't think you need non-CJK characters covered by ngramchars? If I keep both settings, but remove `0..9, A..Z->a..z, , a..z` from the list, the test passes.
Also: really appreciate the test app :)
That's strange. This has been working previously without any problems.
In fact the application I am working on deals with wylie transliterations as well as CJK texts. I will check if it makes sense to exclude the non-CJK characters for wylie.
Anyway, non-CJK characters in ngram_chars should work, right? So this might be a problem with sphinx itself?
Thanks a lot for your help, pat!
I'm not sure if it should work, or even if non-CJK-ish characters should go in the ngram_chars setting. Perhaps worth asking on the Sphinx forum? Better chance of someone familiar with that there :)
This discussion just saved me a lot of time! Thanks to you both + :100:
In thinking-sphinx 2, the following performed an application-wide search, limited to certain classes:
However, in thinking-sphinx 3 there seems to be a problem when multiple classes are specified. Everything works fine when I do not pass the
:classes
option at all, when I pass:classes => [Article]
or:classes => [Comment]
, but when passing:classes => [Article, Comment]
suddenly no results at all are found.The query log (query term "sampleterm") shows this:
(The same issue occurs with
ThinkingSphinx#facets
.)Any ideas on how to resolve that? Am I doing something wrong?