Re: Index the id of another object with gin

[email protected] (Yuval Kogman) Sun, 16 Aug 2009 00:27:21 +0300
Newsgroups perl.kiokudb
Message-ID <[email protected]>
2009/8/10 Ask Bj=F8rn Hansen <[email protected]>:
> Hi -
>
> One more question:
>
> Class A have an owner attribute.  I want to index the id of the =20
> owners of
> the 'A' objects in the gin index.

This is possible to do using the 'entry' parameter to the extraction
callback, but it's kind of clunky. I think this is the best suggestion
I have for a workaround right now, find the owner in the entry and
extract the ID out of the KiokuDB::Reference object.

I need to rework the insertion for GIN backends to also make the top
level directory object available, so you can do things like
$dir->object_to_id($object->relationship) in the query.

It should be possible to make that transformation implicit so that the
extractor can simply return $object->relationship and the translation
to IDs would happen automatically in
KiokuDB::Backend::Role::Query::GIN