Hi,
I have about 9 models (more coming soon) which currently have both common &
unique sphinx attributes in each - these attributes are used as filters &
don't need to be searchable.
Here is an example of some of my models which illustrates the problem:
class Ad
> belongs_to :categories
>
> define_index('ad') do
> has categories.name, :as => :category_name_tags, :facet => true, :type
> => :string
> end
> end
class User
> belongs_to :region
> define_index('ad') do
>
#psudocode below
has "(SELECT name from categories)", :as => :category_name_tags, :facet
> => true, :type => :string
> end
> end
*So that I can search like this:*
results = ThinkingSphinx.search "red car", :with => { :category_name_tags
> => "autos" }, :classes => [Ad, User]
All my non-Ad models need to have an "category_name_tags" attribute defined
which will match any "category_name_tags" filters the user specifies when
searching - in other-words these are dummy attributes that should always
match all certain filters - they are passive for most models, I want to do
this because if these attributes do not exist in my model, then no results
from that model will be returned.
*Note: I cannot modify the data model used by the client.*
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/thinking-sphinx/-/irULT959k9AJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.