Hi everyone,
I need a multi value facet for my application and since I wasn't able
to index it through a field (comma separated string wasn't parsed into
multiple values by Sphinx for some reason) nor through an association,
I decided to add my custom attribute to sphinx configuration.
This is what I've added:
sql_attr_multi = uint localities_ids_facet from query; SELECT
lt.localizable_id * CAST(3 AS SIGNED) + 2 AS id, lca.id AS
localities_ids_facet \
FROM locatings lt \
JOIN localities lc ON lt.locality_id = lc.id \
JOIN localities lca ON lca.lft <= lc.lft AND lca.rgt >= lc.rgt \
WHERE lt.localizable_type="User"
Now when I reindex, everything seems to work just fine. When querying
Sphinx via SphinxQL I can see the MVA's and can filter the results
based on particular values.
The problem is that TS doesn't recognize my attribute so when I call
something like User.facets(:facets => :locality_ids) an empty hash is
returned.
This is obviously because I didn't declare this attribute in my
define_index block.
My question then is: How to force TS to recognize my facet/attribute?
Thanks for any advice!
Milan
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
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.