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

Ask Your Question
0

Compound Indexes over DocumentProperties

Hi, I'm using an entity with DocumentProperties....

@Entity
@SpaceClass
public class Entity implements Externalizable {

    String id;
    DocumentProperties properties  = new DocumentProperties();

    @Id
    @Column(name="id", unique=true)
    @SpaceId(autoGenerate=false)
    public String getId() {
        return id;
    }

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

    @SpaceDynamicProperties
    public DocumentProperties getProperties() {
        return properties;
    }

   .........
}

I want to query the entity using some of the atributes within the DocumentProperties using a SQLQuery:

final SQLQuery<PricingProfile> sqlQuery = new SQLQuery<>(
            Entity.class, "data1 = ? AND data2 = ?",
            "ABC", "123");
 Entity[] resp = gigaSpace.readMultiple(sqlQuery, 10, ReadModifiers.READ_COMMITED));

How can I define a compound index over the data1 and data2 properties????

I try to add using the property name directly in the path like this:

@Entity
@SpaceClass
@CompoundSpaceIndexes({ @CompoundSpaceIndex(paths = {"data1", "data2"}) })
public class Entity implements Externalizable {

Using this, the SQLQuery and space queries starts to fail and never find any object (Always return an empty array).

If I add the docuement properties attribute to the path, it starts working again but i'm not sure if the indexes are used or even created:

@Entity
@SpaceClass
@CompoundSpaceIndexes({ @CompoundSpaceIndex(paths = {"properties.data1", "properties.data2"}) })
public class Entity implements Externalizable {

How I must define the compound indexes? How can i check if the indexes are created correctly and are actually being used?

Im using GigaSpaces XAP 10.2.1 With Java 8

Thanks,

Manuel Vieda

asked 2015-11-13 13:25:41 -0500

updated 2015-11-13 13:26:59 -0500

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

Hi, Setting following log level: com.gigaspaces.dev.level=FINEST at client, will allow you to see how many objects were scanned by the query.

Regards, Ester.

answered 2015-11-16 00:37:27 -0500

Ester gravatar image
edit flag offensive delete link more

Comments

Hi, can you help me exaplaning how to do that when running in standalone mode (IDE):

http://docs.gigaspaces.com/xap102/run...

Manuel Vieda gravatar imageManuel Vieda ( 2015-11-20 15:25:15 -0500 )edit

Hi, In VM options point to your log config file e.g, -Djava.util.logging.config.file=gs-home\config\gs_logging.properties and add logging level -Dcom.gigaspaces.dev.level=FINEST

Ester gravatar imageEster ( 2015-11-22 01:36:46 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2015-11-13 13:25:41 -0500

Seen: 619 times

Last updated: Nov 16 '15