Indexing only the changed values

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?

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 :slight_smile:

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

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?

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 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