ThinkingSphinx.search fails when using star search (3.0.3 & master) #3

Open
rogerkk opened this Issue Jun 30, 2013 · 1 comment

Comments

Projects
None yet
1 participant
@rogerkk

rogerkk commented Jun 30, 2013

Hi,

When performing an applictation wide search using ThinkingSphinx.search, I experience an error when I add "star: true" as a search parameter.

I did a minimal test in the rails console:

1.9.3p327 :020 > result = ThinkingSphinx.search({star: true})
(Object doesn't support #inspect)
 =>  
1.9.3p327 :021 > result.to_a
NoMethodError: undefined method `gsub' for nil:NilClass
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/search/query.rb:32:in `star_keyword'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/search/query.rb:17:in `to_s'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/middlewares/sphinxql.rb:75:in `extended_query'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/middlewares/sphinxql.rb:141:in `block in statement'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/middlewares/sphinxql.rb:138:in `tap'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/middlewares/sphinxql.rb:138:in `statement'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/middlewares/sphinxql.rb:25:in `call'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/middlewares/sphinxql.rb:10:in `block in call'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/middlewares/sphinxql.rb:9:in `each'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/middlewares/sphinxql.rb:9:in `call'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/middlewares/stale_id_filter.rb:10:in `call'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/middleware-0.1.0/lib/middleware/runner.rb:31:in `call'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/middleware-0.1.0/lib/middleware/builder.rb:102:in `call'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/search.rb:65:in `populate'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/thinking-sphinx-3.0.3/lib/thinking_sphinx/search.rb:89:in `to_a'
    from (irb):21
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
    from /home/rkk/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'1.9.3p327 :022 > 

Any other searches I perform using the same method, but without the star parameter, works fine.

@rogerkk

This comment has been minimized.

Show comment Hide comment
@rogerkk

rogerkk Jun 30, 2013

Oops, posted this to the wrong GitHub account. Posted it at pat/thinking-sphinx#548 now.

rogerkk commented Jun 30, 2013

Oops, posted this to the wrong GitHub account. Posted it at pat/thinking-sphinx#548 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment