Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Indexing and querying HashMaps

Dear all, how do you index and query the key of an hashmap property of a space class?

http://www.gigaspaces.com/wiki/displa...

Shows how to do that with a property of values of the map, but not with keys.

Also, the information about mapping appearing at http://www.gigaspaces.com/wiki/displa... , on how to index a map value, should appear in the part of the doc called indexing. It took me ages to find it!

Best Regards

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3771]{quote}

asked 2011-10-27 06:54:12 -0500

edmondo1984 gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

We don't quite understand what you mean by querying the key of a map as opposed to querying a value.

Suppose we have the following class:

public class MyClass {
        @SpaceIndex(path="foo")
        public Map<String, Object> getData() {...}
        public void setData(Map<String, Object> data) {...}
}

The query "new SQLQuery(MyClass.class, "data.foo=5")" will match entries of type MyClass whose data map contains a property called "foo" with value 5.
If "data.foo" is indexed (as shown in this example), the query will execute faster.

Could you clarify what functionality are you missing based on this example?

In addition, thank you for your input about our wiki documentation. we've reviewed the indexing page (http://www.gigaspaces.com/wiki/display/XAP8/Indexing) and saw that it contains a section about indexing nested properties (http://www.gigaspaces.com/wiki/display/XAP8/Indexing#Indexing-NestedPropertiesIndexing).
Could you please elaborate what information is missing from this page?

Niv Ingberg

answered 2011-10-30 04:50:14 -0500

niv gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-10-27 06:54:12 -0500

Seen: 356 times

Last updated: Oct 30 '11