Index woes

goran at krampe.se goran at krampe.se
Tue Aug 29 07:56:57 UTC 2006


Howdy!

I have problems with indexing. I have an index type that looks like
this:

indexHashForIndexObject: aUniqueObject
	^ aUniqueObject id maUint: self keySize at: 0

keySize
	^ 128


More concretely - a Q2Case in Gjallar has a reference to a
Q2WorkflowStage (the node in the workflow graph it is situated at). A
Q2WorkflowStage has an id which is a UUID.

The problem is that the index is not "working". :) Is there any
principal problem with the above? The stage would never change its id
btw.

If we do:

	cases select: [:c | c stage == processes first workflow stages first]

We get correctly:

	a Bag
	(1) Q2Case[4]
	(1) Q2Case[2]
	(1) Q2Case[1]
	(1) Q2Case[7]
	(1) Q2Case[5]
	(1) Q2Case[6]

But if we do:

(cases where: [:r | r read: #stage from: processes first workflow stages
first to: processes first workflow stages first]) size

... we get 0 instead of those 6. The index was created using:

	cases addIndex: (MaUniqueObjectIndex attribute: #stage).

And stage:/stage are just simple accessors.

I also wonder how I can rebuild an index - remove and add it? Hmmm. Ok,
I did that, and then testing the above *almost* worked - but Q2Case[1]
is missing from the index! So I only get 5 hits.

regards, Göran


More information about the Magma mailing list