Hi Pascal,

an attribute is multi-valued if Sphinx sees more than one value for
it. (Well, that's not too surprising.) Since Thinking Sphinx generates
a configuration for the Sphinx indexer that tells it how to get data
from the SQL database, MVA are limited to everything you can do in
SQL. In particular, you can't have a method of your model that returns
a Ruby array of some sort and directly convert this into a MVA,
because the indexer doesn't speak to your model but only to the
database.

OK, so MVA are related to ActiveRecord associations. Like, class
Book :has_many :chapters or else. In the index definitions of that
class "Book" you could write:

indexes chapters.title, :as=>'chapter_title', :facet=>true

Depending on whether your activate facets or not (using :facet=>true)
Sphinx will either see all values of chapter.title concatenated by
spaces, or (if it's a facet) as a list of CRC32 checksums of all
chapter titles, separated by commas. Only the latter is a MVA from
Sphinx' perspective, the first is just one long string.

There's currently an open issue with facets of MVA that leads to
unexpected results, but it is about to be resolved. Regards,

Christian

On 18 Aug., 13:51, pascal <[email protected]> wrote:
> Hi
>
> Some questions on MVA, hope there is someone around who can help me...
>
> How does Sphinx/TS parse MVA attributes? i could not find a
> description of what is acceptable.
> I found something that said it has to be CSV (comma separated values)
> while it looks like space and dot are also ok?
>
> I've got some troubles getting MVA and facets working. Is it
> supported?
> rake ts:in generates
> WARNING: attribute 'path_ids_facet' not found - IGNORING
> and the path_id attribute is not indexed.
>
> the attributes appear in the ThinkingSphinx.facets hash but 'path_ids'
> is always empty.
>
> Thanks for your help and time.
>
> Pascal
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to