--
You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thinking-sphi...@googlegroups.com.
To post to this group, send email to thinkin...@googlegroups.com.
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Thinking Sphinx" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/thinking-sphinx/7llAB4zO4bw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to thinking-sphi...@googlegroups.com.
The `where` method doesn't apply for real-time indices - but try this instead in the index definition block:
scope { Issue.where "account_status_id IN (1,2) AND archived IS false" }
That should ensure only the appropriate issues are indexed as part of the generate call.
Beyond that, you may wish to add `includes` within that scope to cover all associations used within the index?
Unrelated to any of this: the match_mode defaults to extended with TS v3 (indeed, it can't be anything else).
--
Pat
On 1 Mar 2014, at 2:09 am, Garrett Dimon <gar...@nextupdate.com> wrote:
> Roger on the generation. Any high-level suggestions for optimization?
>
> I'll see if I can't figure out the exact record that's tripping up the index generation. In the meantime, here's a gist of our index definition:
> https://gist.github.com/garrettdimon/25f6c305541f30b3ce39
>
>
> On Thu, Feb 27, 2014 at 9:21 PM, Pat Allan <p...@freelancing-gods.com> wrote:
> Hi Garrett
>
> Generation can be slow - at the end of the day, it really comes down to how much data you're dealing with, and if you're using aggregation methods, how quick they are. It's all going through your Rails app (instead of just SQL queries), so optimising for that is different to adding db indices and such.
>
> As for the error though... without having a copy of the database, it's a little hard to debug, but it sounds like there's a bug in TS with something in the data being passed through. Having a look at your app log may help identify the record in question... also, what does the index definition for that model look like?
>
> --
The `where` method doesn't apply for real-time indices - but try this instead in the index definition block:
scope { Issue.where "account_status_id IN (1,2) AND archived IS false" }
That should ensure only the appropriate issues are indexed as part of the generate call.
Beyond that, you may wish to add `includes` within that scope to cover all associations used within the index?
Unrelated to any of this: the match_mode defaults to extended with TS v3 (indeed, it can't be anything else).
--
Pat
On 1 Mar 2014, at 2:09 am, Garrett Dimon <gar...@nextupdate.com> wrote:
> Roger on the generation. Any high-level suggestions for optimization?
>
> I'll see if I can't figure out the exact record that's tripping up the index generation. In the meantime, here's a gist of our index definition:
> https://gist.github.com/garrettdimon/25f6c305541f30b3ce39
>
>
> On Thu, Feb 27, 2014 at 9:21 PM, Pat Allan <p...@freelancing-gods.com> wrote:
> Hi Garrett
>
> Generation can be slow - at the end of the day, it really comes down to how much data you're dealing with, and if you're using aggregation methods, how quick they are. It's all going through your Rails app (instead of just SQL queries), so optimising for that is different to adding db indices and such.
>
> As for the error though... without having a copy of the database, it's a little hard to debug, but it sounds like there's a bug in TS with something in the data being passed through. Having a look at your app log may help identify the record in question... also, what does the index definition for that model look like?
>
> --