In terms of the indexing, the same key that you use in the cache is
pretty much stored as the key. Strictly it's the key + some metadata. So
as long as you don't do something like: -
int key1 = 5;
cache.put(key1, value1);
double key1 = 5;
cache.put(key1, value2);
This way, the interceptor will think that two separate keys are being
used. Even though they are both the same number, when the String
representation is built, they will have metadata about the type and
hence be different String representations.
I guess my point here is that there are cases where we need to treat
this issue with perhaps a little bit more care. The other gurus here
will probably have a better idea on this.
But I'm using string keys. Something like this:
String key = "mykey";
IndexableObject a = new IndexableObject("oldobject");
cache.put(key, a);
IndexableObject b = new IndexableObject("test2");
cache.put(key, b);
And when I search for "oldobject", the query returns the object stored on
key "mykey" (because IndexableObject("oldobject") still is on the
index).
Israel Lacerra