Thanks for the response.  Looks like I just needed to change: "...
products.id * 1 + 0 ..." to "... products.id * 2 + 0 ...".  When I
added the ProductApplication index, it became the first index in
*.sphinx.conf.

On Jan 1, 10:48 pm, Pat Allan <[email protected]> wrote:
> Hi James
>
> Is ProductApplication a subclass of Product? Just wondering why you're 
> stating the index as a secondary one...
>
> Either way, looking at the generated *.sphinx.conf file (minus database 
> passwords) is a good place to start. And what kind of search queries are you 
> trying?
>
> --
> Pat
>
> On 31/12/2009, at 8:40 AM, James Earl wrote:
>
> > I just added a new, second index, and I'm now getting incorrect
> > results... and I'm not touching/using the new index.  If I remove the
> > new/second define_index block, the problem goes away.  The second
> > index is bare bones.  The problem appears to be related to a source
> > query attribute in my primary index.  Enabling my new/second index,
> > and commenting out the source query attribute, and replacing it with a
> > simple category_id attribute and things work.
>
> > In terms of what results I'm getting that are wrong... basically just
> > products from other categories other than the one I'm currently
> > viewing.
>
> > # 1. Primary index
> > class Product
> >  define_index do
> >    ...
> >    has "SELECT products.id * 1 + 0 AS id, c1.id AS category_ids FROM
> > products LEFT JOIN categories ON products.category_id = categories.id
> > LEFT OUTER JOIN categories c1 ON categories.lft BETWEEN c1.lft AND
> > c1.rgt", :as => :category_ids, :source => :query
> >  end
> > end
>
> > # 2. New secondary index
> > class ProductApplication
> >  define_index do
> >    indexes whatever
> >  end
> > end
>
> > Are there any gotchas I could be overlooking?
>
> > Thanks
>
> > --
>
> > 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 
> > athttp://groups.google.com/group/thinking-sphinx?hl=en.

--

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