Hi Mikael,
You can specify indexed types via CacheConfiguration#setIndexedTypes()
method.
For instance:
CacheConfiguration ccfg = new CacheConfiguration<>();
ccfg.setIndexedTypes(Long.class, Person.class);
Another possible way is DDL statement:
// Create table based on PARTITIONED template with one backup.
cache.query(new SqlFieldsQuery(
"CREATE TABLE person (id LONG, name VARCHAR, city_id LONG, PRIMARY KEY
(id, city_id)) " +
"WITH \"backups=1, affinity_key=city_id\"")).getAll();
// Create an index.
cache.query(new SqlFieldsQuery("CREATE INDEX on Person
(city_id)")).getAll();
[1]
https://apacheignite-sql.readme.io/docs/schema-and-indexes#section-registering-indexed-types
[2] https://apacheignite-sql.readme.io/docs/create-index
[3]
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/sql/SqlDdlExample.java
Thanks!
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/