acts_as_solr returns all rows in the database when using the model as search query
Posted
by chris Chan
on Stack Overflow
See other posts from Stack Overflow
or by chris Chan
Published on 2009-01-16T19:07:17Z
Indexed on
2010/04/01
19:53 UTC
Read the original article
Hit count: 302
In our application we're using acts_as_solr for search. Everything seems to be running smoothly except for the fact that using the model name as the search query returns every single row in the table.
For example, let's say we have a users table. We specify acts_as_solr in our model to search the fields first name, last name and handle acts_as_solr :fields => [:handle, :lname, :fname]. When you use "user" as the search term it returns every single user in the system, or every row in the database as a result.
Has anyone else run into this?
© Stack Overflow or respective owner