in my define_index block inside the Task model i have a where clause
where 'project.status != "closed"'
but everytime I change the project status, I have to reindex else the search results will be wrong. Is there any better way to do this? I have delayed delta indexing enabled for tasks. I wonder if I also need to do this for projects.
I guess what you'll want to do is have a after_commit hook on your project model that updates the delta flags on all tasks for that project (which will in turn fire the delta callback for them). This will ensure Sphinx's data is close to up-to-date.
How many tasks are generally tied to a project?
-- Pat
On 18/11/2011, at 10:47 AM, Jim Ruther Nill wrote:
> in my define_index block inside the Task model i have a where clause
> where 'project.status != "closed"'
> but everytime I change the project status, I have to reindex else the > search results will be wrong. Is there any better way to do this? I have > delayed delta indexing enabled for tasks. I wonder if I also need to do > this for projects.
> Thanks!
> -- > You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. > To post to this group, send email to thinking-sphinx@googlegroups.com. > To unsubscribe from this group, send email to thinking-sphinx+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
Thanks for getting back to me. There's no limit to the number of tasks per project. A good estimate would be around 50 tasks per project. Does this mean that everytime the project changes status, i have to update those 50 tasks? Sorry but does that also mean that the delayed delta will queue 50 jobs to delayed_job?
Thanks!
Jim
On Fri, Nov 18, 2011 at 10:09 PM, Pat Allan <p...@freelancing-gods.com>wrote:
> I guess what you'll want to do is have a after_commit hook on your project > model that updates the delta flags on all tasks for that project (which > will in turn fire the delta callback for them). This will ensure Sphinx's > data is close to up-to-date.
> How many tasks are generally tied to a project?
> -- > Pat
> On 18/11/2011, at 10:47 AM, Jim Ruther Nill wrote:
> > Hi!
> > in my define_index block inside the Task model i have a where clause
> > where 'project.status != "closed"'
> > but everytime I change the project status, I have to reindex else the > > search results will be wrong. Is there any better way to do this? I > have > > delayed delta indexing enabled for tasks. I wonder if I also need to do > > this for projects.
> > Thanks!
> > -- > > You received this message because you are subscribed to the Google > Groups "Thinking Sphinx" group. > > To post to this group, send email to thinking-sphinx@googlegroups.com. > > To unsubscribe from this group, send email to > thinking-sphinx+unsubscribe@googlegroups.com. > > For more options, visit this group at > http://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 thinking-sphinx@googlegroups.com. > To unsubscribe from this group, send email to > thinking-sphinx+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en.
-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com
At a basic level, you'd need to update all of those tasks, but jobs will not be duplicated (however, if a job is completed before all 50 tasks are updated, then another would be added).
There is a better way, of course - it's just a little more fiddly.
Firstly, update the delta flags in one SQL statement (assuming this is done within the context of a project object):
> Thanks for getting back to me. There's no limit to the number of tasks per project. > A good estimate would be around 50 tasks per project. Does this mean that > everytime the project changes status, i have to update those 50 tasks? Sorry but > does that also mean that the delayed delta will queue 50 jobs to delayed_job?
> Thanks!
> Jim
> On Fri, Nov 18, 2011 at 10:09 PM, Pat Allan <p...@freelancing-gods.com> wrote: > Hi Jim
> I guess what you'll want to do is have a after_commit hook on your project model that updates the delta flags on all tasks for that project (which will in turn fire the delta callback for them). This will ensure Sphinx's data is close to up-to-date.
> How many tasks are generally tied to a project?
> -- > Pat
> On 18/11/2011, at 10:47 AM, Jim Ruther Nill wrote:
> > Hi!
> > in my define_index block inside the Task model i have a where clause
> > where 'project.status != "closed"'
> > but everytime I change the project status, I have to reindex else the > > search results will be wrong. Is there any better way to do this? I have > > delayed delta indexing enabled for tasks. I wonder if I also need to do > > this for projects.
> > Thanks!
> > -- > > You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. > > To post to this group, send email to thinking-sphinx@googlegroups.com. > > To unsubscribe from this group, send email to thinking-sphinx+unsubscribe@googlegroups.com. > > For more options, visit this group at http://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 thinking-sphinx@googlegroups.com. > To unsubscribe from this group, send email to thinking-sphinx+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
> -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.com
> -- > You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. > To post to this group, send email to thinking-sphinx@googlegroups.com. > To unsubscribe from this group, send email to thinking-sphinx+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
On Sun, Nov 20, 2011 at 1:47 PM, Pat Allan <p...@freelancing-gods.com> wrote: > At a basic level, you'd need to update all of those tasks, but jobs will > not be duplicated (however, if a job is completed before all 50 tasks are > updated, then another would be added).
> There is a better way, of course - it's just a little more fiddly.
> Firstly, update the delta flags in one SQL statement (assuming this is > done within the context of a project object):
> On 18/11/2011, at 11:02 PM, Jim Ruther Nill wrote:
> > Hi Pat,
> > Thanks for getting back to me. There's no limit to the number of tasks > per project. > > A good estimate would be around 50 tasks per project. Does this mean > that > > everytime the project changes status, i have to update those 50 tasks? > Sorry but > > does that also mean that the delayed delta will queue 50 jobs to > delayed_job?
> > Thanks!
> > Jim
> > On Fri, Nov 18, 2011 at 10:09 PM, Pat Allan <p...@freelancing-gods.com> > wrote: > > Hi Jim
> > I guess what you'll want to do is have a after_commit hook on your > project model that updates the delta flags on all tasks for that project > (which will in turn fire the delta callback for them). This will ensure > Sphinx's data is close to up-to-date.
> > How many tasks are generally tied to a project?
> > -- > > Pat
> > On 18/11/2011, at 10:47 AM, Jim Ruther Nill wrote:
> > > Hi!
> > > in my define_index block inside the Task model i have a where clause
> > > where 'project.status != "closed"'
> > > but everytime I change the project status, I have to reindex else the > > > search results will be wrong. Is there any better way to do this? I > have > > > delayed delta indexing enabled for tasks. I wonder if I also need to > do > > > this for projects.
> > > Thanks!
> > > -- > > > You received this message because you are subscribed to the Google > Groups "Thinking Sphinx" group. > > > To post to this group, send email to thinking-sphinx@googlegroups.com. > > > To unsubscribe from this group, send email to > thinking-sphinx+unsubscribe@googlegroups.com. > > > For more options, visit this group at > http://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 thinking-sphinx@googlegroups.com. > > To unsubscribe from this group, send email to > thinking-sphinx+unsubscribe@googlegroups.com. > > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en.
> > -- > > ------------------------------------------------------------- > > visit my blog at http://jimlabs.heroku.com
> > -- > > You received this message because you are subscribed to the Google > Groups "Thinking Sphinx" group. > > To post to this group, send email to thinking-sphinx@googlegroups.com. > > To unsubscribe from this group, send email to > thinking-sphinx+unsubscribe@googlegroups.com. > > For more options, visit this group at > http://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 thinking-sphinx@googlegroups.com. > To unsubscribe from this group, send email to > thinking-sphinx+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en.
-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com
> On Sun, Nov 20, 2011 at 1:47 PM, Pat Allan <p...@freelancing-gods.com>wrote:
>> At a basic level, you'd need to update all of those tasks, but jobs will >> not be duplicated (however, if a job is completed before all 50 tasks are >> updated, then another would be added).
>> There is a better way, of course - it's just a little more fiddly.
>> Firstly, update the delta flags in one SQL statement (assuming this is >> done within the context of a project object):
>> On 18/11/2011, at 11:02 PM, Jim Ruther Nill wrote:
>> > Hi Pat,
>> > Thanks for getting back to me. There's no limit to the number of tasks >> per project. >> > A good estimate would be around 50 tasks per project. Does this mean >> that >> > everytime the project changes status, i have to update those 50 tasks? >> Sorry but >> > does that also mean that the delayed delta will queue 50 jobs to >> delayed_job?
>> > Thanks!
>> > Jim
>> > On Fri, Nov 18, 2011 at 10:09 PM, Pat Allan <p...@freelancing-gods.com> >> wrote: >> > Hi Jim
>> > I guess what you'll want to do is have a after_commit hook on your >> project model that updates the delta flags on all tasks for that project >> (which will in turn fire the delta callback for them). This will ensure >> Sphinx's data is close to up-to-date.
>> > How many tasks are generally tied to a project?
>> > -- >> > Pat
>> > On 18/11/2011, at 10:47 AM, Jim Ruther Nill wrote:
>> > > Hi!
>> > > in my define_index block inside the Task model i have a where clause
>> > > where 'project.status != "closed"'
>> > > but everytime I change the project status, I have to reindex else the >> > > search results will be wrong. Is there any better way to do this? I >> have >> > > delayed delta indexing enabled for tasks. I wonder if I also need to >> do >> > > this for projects.
>> > > Thanks!
>> > > -- >> > > You received this message because you are subscribed to the Google >> Groups "Thinking Sphinx" group. >> > > To post to this group, send email to thinking-sphinx@googlegroups.com >> . >> > > To unsubscribe from this group, send email to >> thinking-sphinx+unsubscribe@googlegroups.com. >> > > For more options, visit this group at >> http://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 thinking-sphinx@googlegroups.com. >> > To unsubscribe from this group, send email to >> thinking-sphinx+unsubscribe@googlegroups.com. >> > For more options, visit this group at >> http://groups.google.com/group/thinking-sphinx?hl=en.
>> > -- >> > ------------------------------------------------------------- >> > visit my blog at http://jimlabs.heroku.com
>> > -- >> > You received this message because you are subscribed to the Google >> Groups "Thinking Sphinx" group. >> > To post to this group, send email to thinking-sphinx@googlegroups.com. >> > To unsubscribe from this group, send email to >> thinking-sphinx+unsubscribe@googlegroups.com. >> > For more options, visit this group at >> http://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 thinking-sphinx@googlegroups.com. >> To unsubscribe from this group, send email to >> thinking-sphinx+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/thinking-sphinx?hl=en.
> -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.com
-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com