CREATE KEYSPACE my_keyspace WITH replication =
{
'class': 'SimpleStrategy',
'replication_factor' : 1
};
USE MY_KEYSPACE;
CREATE TABLE PERSON (
id int primary key,
isActive boolean,
age int,
eyeColor varchar,
name text,
gender varchar,
company varchar,
email varchar,
phone varchar,
address text,
stargate text
);
CREATE CUSTOM INDEX person_idx ON PERSON(stargate) USING
'com.tuplejump.stargate.RowIndex' WITH options =
{
'sg_options':'{
"fields":{
"age":{},
"eyeColor":{},
"name":{},
"gender":{},
"company":{},
"phone":{},
"address":{},
"isActive":{}
}
}'
};
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(1,false,29,'green','Davidson Hurst','male','TALKOLA','[email protected]','+1 (950) 405-2257','691 Hampton Place, Felt, North Carolina, 8466');
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(2,false,27,'black','Maxwell Kemp','male','AMTAP','[email protected]','+1 (800) 495-3822','466 Kenilworth Place, Fivepointville, Maryland, 6240');
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(3,false,25,'black','Cecelia Cain','female','MAINELAND','[email protected]','+1 (874) 590-2058','644 Broome Street, Rutherford, Delaware, 6271');
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(4,true,28,'green','Morse Sanders','male','APEX','[email protected]','+1 (857) 427-3391','786 Division Avenue, Rose, Rhode Island, 4217');
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(5,true,25,'black','Fernandez Morse','male','OPTICALL','[email protected]','+1 (911) 442-2649','116 Suydam Place, Libertytown, Michigan, 2257');
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(6,false,27,'brown','Ryan Ross','male','ZAPHIRE','[email protected]','+1 (843) 423-2420','804 Erskine Loop, Robinette, Marshall Islands, 9161');
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(7,true,34,'brown','Avis Mosley','female','TETRATREX','[email protected]','+1 (883) 461-3832','391 Heyward Street, Hayes, Alabama, 5934');
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(8,false,29,'black','Juana Ewing','female','REPETWIRE','[email protected]','+1 (809) 410-2791','510 Lake Avenue, Austinburg, Virgin Islands, 2964');
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(9,false,33,'brown','Edwards Patton','male','MANGELICA','[email protected]','+1 (977) 508-2935','131 Stone Avenue, Cucumber, Minnesota, 4601');
INSERT INTO PERSON(id,isActive,age,eyeColor,name,gender,company,email,phone,address) VALUES(10,false,38,'blue','Weaver Carson','male','ISOLOGIX','[email protected]','+1 (916) 566-2681','560 Hanson Place, Gardners, Puerto Rico, 7821');
Above are the data collection scripts. After the same, following query gives 3 results:
SELECT * FROM PERSON WHERE stargate ='{ filter: { type: "range", field: "age", lower: 30 } }';
As soon as we run the following update:
update PERSON set company = 'ISOLOGIX1' where id = 10;
and then run the above select again, the id=10 row goes away.
This issue is making us restrict from moving ahead.
Regards,
Amit Khare