Hi all, i have model A which has a field indexed from model B. model A belongs to model B. So whenever i insert a row in model ''A'', a query is fired to the field from model ''B'' even though the data was not changed for the field in model B. Can i somehow avoid these extra queries,or rather query the data and index it,only if the data has been changed>? e.g model A { message chat Name } model B{ chat Name } For 1 chatName there are 10 messages.so i want to index chatName once per 10 messages and not 10 times.How do i do this? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20070730/0cc8044b/attachment.html
Hey.. Ferret does not allow you to update information in the index. You can either add information or remove information. There is no SQL-like ''UPDATE'' statement. Ferret or AAF - whatever you use - need all information, if you want to index something. And AAF does not keep track of changes in the model, so it will not allow you to add a flag like :only_index_dependencies_if_model_really_changed :) So if you want to avoid your extra queries, build some caching inside your model classes. This has nothing to do with Ferret. E.g. try storing your data in a memcache with a short TTL or think of any other caching mechanism that will work for your model, regardless of Ferret. Ben On 2007-07-30, at 2:32 PM, isha kakodkar wrote:> Hi all, > i have model A which has a field indexed from model B. model A > belongs to model B. > So whenever i insert a row in model ''A'', a query is fired to the > field from model ''B'' even though the data was not changed for the > field in model B. > Can i somehow avoid these extra queries,or rather query the data > and index it,only if the data has been changed>? > e.g model A { > message > chat Name > } > > > model B{ > chat Name > } > > > For 1 chatName there are 10 messages.so i want to index chatName > once per 10 messages and not 10 times.How do i do this? > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk
ok thanks... Can i specify :group clause while searching....I want to apply a groupBy clause in sql to get the resultset and index it... Can i do it with Ferret? On 7/30/07, Benjamin Krause <bk at benjaminkrause.com> wrote:> > Hey.. > > Ferret does not allow you to update information in > the index. You can either add information or remove > information. There is no SQL-like ''UPDATE'' > statement. Ferret or AAF - whatever you use - need > all information, if you want to index something. And > AAF does not keep track of changes in the model, > so it will not allow you to add a flag like > :only_index_dependencies_if_model_really_changed :) > > So if you want to avoid your extra queries, build some > caching inside your model classes. This has nothing to > do with Ferret. E.g. try storing your data in a memcache > with a short TTL or think of any other caching mechanism > that will work for your model, regardless of Ferret. > > > Ben > > > > On 2007-07-30, at 2:32 PM, isha kakodkar wrote: > > > Hi all, > > i have model A which has a field indexed from model B. model A > > belongs to model B. > > So whenever i insert a row in model ''A'', a query is fired to the > > field from model ''B'' even though the data was not changed for the > > field in model B. > > Can i somehow avoid these extra queries,or rather query the data > > and index it,only if the data has been changed>? > > e.g model A { > > message > > chat Name > > } > > > > > > model B{ > > chat Name > > } > > > > > > For 1 chatName there are 10 messages.so i want to index chatName > > once per 10 messages and not 10 times.How do i do this? > > _______________________________________________ > > Ferret-talk mailing list > > Ferret-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ferret-talk > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20070730/752e7e39/attachment.html
hi,i needed some help on specifying conditions for index searching on filesystem. Along with the main query string,i can give the indexed_field:value,so that it searches the query string at that indexed row. But can i specify a indexed_field > value? or i have to give the exact value? On 7/30/07, isha kakodkar <isha.kakodkar at gmail.com> wrote:> > ok thanks... > Can i specify :group clause while searching....I want to apply a groupBy > clause in sql to get the resultset and index it... > Can i do it with Ferret? > > > On 7/30/07, Benjamin Krause <bk at benjaminkrause.com> wrote: > > > > Hey.. > > > > Ferret does not allow you to update information in > > the index. You can either add information or remove > > information. There is no SQL-like ''UPDATE'' > > statement. Ferret or AAF - whatever you use - need > > all information, if you want to index something. And > > AAF does not keep track of changes in the model, > > so it will not allow you to add a flag like > > :only_index_dependencies_if_model_really_changed :) > > > > So if you want to avoid your extra queries, build some > > caching inside your model classes. This has nothing to > > do with Ferret. E.g. try storing your data in a memcache > > with a short TTL or think of any other caching mechanism > > that will work for your model, regardless of Ferret. > > > > > > Ben > > > > > > > > On 2007-07-30, at 2:32 PM, isha kakodkar wrote: > > > > > Hi all, > > > i have model A which has a field indexed from model B. model A > > > belongs to model B. > > > So whenever i insert a row in model ''A'', a query is fired to the > > > field from model ''B'' even though the data was not changed for the > > > field in model B. > > > Can i somehow avoid these extra queries,or rather query the data > > > and index it,only if the data has been changed>? > > > e.g model A { > > > message > > > chat Name > > > } > > > > > > > > > model B{ > > > chat Name > > > } > > > > > > > > > For 1 chatName there are 10 messages.so i want to index chatName > > > once per 10 messages and not 10 times.How do i do this? > > > _______________________________________________ > > > Ferret-talk mailing list > > > Ferret-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/ferret-talk > > > > _______________________________________________ > > Ferret-talk mailing list > > Ferret-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ferret-talk > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20070808/c7c1e437/attachment.html
On Wed, Aug 08, 2007 at 07:19:25AM -0700, isha kakodkar wrote:> hi,i needed some help on specifying conditions for index searching on > filesystem. > Along with the main query string,i can give the indexed_field:value,so that > it searches the query string at that indexed row. > But can i specify a indexed_field > value? > or i have to give the exact value?Check out RangeQueries. http://ferret.davebalmain.com/api/classes/Ferret/QueryParser.html Jens -- Jens Kr?mer http://www.jkraemer.net/ - Blog http://www.omdb.org/ - The new free film database