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

Ask Your Question

Compound indexes with dynamic properties

Hi. I want to create a spaceClass with the following data:


  • id

  • data1 (Index BASIC)

  • data2

  • dp1 (Index BASIC)

  • dp2 (Index BASIC)

  • .... any other data

Data1 and Data2 are regular POJO attributes and DP1 and DP2 are dynamic properties. Some of the properties have BASIC indexes. Is the following class declaration and annotations correct? (Specially the dynamic properties)

 public class MyClass {

        String id;
        String data1;
        String data2;

        DocumentProperties properties  = new DocumentProperties();

        @Column(name="id", unique=true)
        public String getId() {
            return id;

        public void setId(String id){
            this.id = id;

        public String getData1(){
            return data1;

        public void setData1(String data1){
            this.data1 = data1;

        public String getData2(){
            return data2;

        public void setData2(String data2){
            this.data2 = data2;

        // DynamicProperties

            @SpaceIndex(path = "dp1", type = SpaceIndexType.BASIC)
        public DocumentProperties getProperties() {
            return properties;

        public String getDP1(){
            return properties.getProperty("dp1");

        public void setDP1(String dp1){
            properties.setProperty("dp1", dp1);

        public String getDP2(){
            return  properties.getProperty("dp2");

        public void setDP1(String dp2){
            properties.setProperty("dp2", dp2);


If I have some polling container and internal queries that uses two or even the three indexes attributes, how can I define the compound indexes? I see the documentation at http://docs.gigaspaces.com/xap100/ind... and want to know if is it possible to mix the regular indexes with the compound indexes. In other words, if I add the following annotations the class definition will be correct?

    @CompoundSpaceIndex(paths = {"dp1", "dp2"}) },
    @CompoundSpaceIndex(paths = {"data1", "dp1", "dp2"}) }
public class MyClass {

 ... The same as the previous example

Thanks, Manuel

asked 2015-01-29 15:37:01 -0500

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

A compound index using multiple segments is not supported.

Can you provide examples for the queries you are trying to execute?

Why can't you list all the compound index attributes like this:

@CompoundSpaceIndexes( { @CompoundSpaceIndex(paths = {"dp1", "dp2","data1"}) } } )

answered 2015-01-30 08:58:22 -0500

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


Asked: 2015-01-29 15:37:01 -0500

Seen: 181 times

Last updated: Jan 30 '15