Unable to reset the "schema"

Hi,

I've just installed flying sphinx in one of my heroku apps. Actually, there was an error in my define_index block: I added a field that didn't exist. I fixed it and ran rake fs:rebuild (+ heroku restart). Unfortunately, I keep having the following error:
Sphinx Sphinx Daemon returned error: index product_core: query error: no field 'visible' found in schema

And in my product.rb model, I've got:

define_index do
  indexes name, :sortable => true
  indexes keywords
  indexes catcher

Any thoughts ?
thanks !

Didier

  1. Hi Didier

    Seems like the error is from when you're searching - what's the search query that's causing the error?

    Pat

  2. You're right Pat ! My bad, thanks !

  3. No worries :)

    Pat

  4. Pat Allan closed this discussion on 12 Jul, 2011 09:07 AM.

  5. Didier Lafforgue re-opened this discussion on 12 Jul, 2011 09:13 AM

  6. It works now !
    Other question: is there a way to get the generated schema ? Because I had to remove the "has visible" statement (my products sql table does have a visible which is a boolean column) in the define_index because it was causing some problems (cf my initial question).
    I just wanted to check if the rake fs:index includes the visible column in the query.
    thanks !

    p.s.: this application worked well on my custom server. I used thinking-sphinx version 1.2.12

  7. Hi Didier

    You probably didn't see this error on your old server because TS didn't pass on the errors that Sphinx was generating (and possibly Sphinx wasn't as fussy then).

    When you say you'd like to check the schema - do you mean programmatically? For example - to use the filter on visible for some searches but not others? Or would you like to see the generated Sphinx configuration file?

    The latter isn't possible at this point in time (though I'm happy to look at the file myself if you need some feedback for debugging), but as for the latter, you can get access to models' attributes using the following code:

    Product.define_indexes
    Product.sphinx_indexes.first.sources.first.attributes.collect &:unique_name
    
  8. Hi Pat !

    Thanks for your help. You are probably right about the hidden error on my server.
    So I read the sphinx doc and I found this: where sanitize_sql(['visible', true])
    it solved my problem !
    You can close the ticket.
    Thank you again so much for your help

    Didier

  9. Pat Allan closed this discussion on 12 Jul, 2011 11:05 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions