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 Posted by Pat Allan Support staff on 12 Jul, 2011 08:55 AM
Hi Didier
Seems like the error is from when you're searching - what's the search query that's causing the error?
Pat
#2 Posted by Didier Lafforgu... on 12 Jul, 2011 08:56 AM
You're right Pat ! My bad, thanks !
#3 Posted by Pat Allan Support staff on 12 Jul, 2011 09:02 AM
No worries :)
Pat
Pat Allan closed this discussion on 12 Jul, 2011 09:07 AM.
Didier Lafforgue re-opened this discussion on 12 Jul, 2011 09:13 AM
#4 Posted by Didier Lafforgu... on 12 Jul, 2011 09:13 AM
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
#5 Posted by Pat Allan Support staff on 12 Jul, 2011 10:54 AM
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:
#6 Posted by Didier Lafforgu... on 12 Jul, 2011 08:01 PM
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
Pat Allan closed this discussion on 12 Jul, 2011 11:05 PM.