If Set up Thinking Sphinx on my application now
Everything was workinf fine
Until I decide to do a conditions query with Thinking Sphinx
PartPriceRecord.search "50002" ,:conditions => { :supplier_id =>
"supp50002" },:star => true
and it reported me with the above error
ThinkingSphinx::SphinxError: index part_price_record_core: query
error: no field 'supplier_id' found in schema
seeing even the Ryan Bates Screencast
http://railscasts.com/episodes/120-thinking-sphinx
he seem to achieve the conditions clauses with "has" method defined
for the column
something like
has :author_id
Reading to one of the post by Pate Allen (scroll down to bottom)
https://groups.google.com/group/thinking-sphinx/browse_thread/thread/1dad41c934bfae41/bfe498c6266102b1?lnk=gst&q=+query+error%3A+no+field+#bfe498c6266102b1
" :with should be used for attribute filters, and :conditions for
field queries. "
so changing my above code with clause
PartPriceRecord.search "PartNumber50002",:with => {:supplier_id =>
"supp50002" },:star => true
and I get no result which is wrong as I can see Record for
"supplier_id" for part_number "PartNumber50002" in by database
Now I'm confuse
why is above error appearing and also what the fundamental difference
between "fields" and "attribute"
can anyone help
BTW here my indexes definition
define_index do
indexes part_number
has supplier_id
end
sphinx_scope(:supplier) { |name|
{:conditions => {:supplier_id => supplier}}
}