I have an existing datastore entity as below:
@Data
@Entity
public class Data
{
@Id @Index long id;
long subId;
boolean expired;
boolean claimed;
}
I am in need to filter the data based on subId, expired an claimed fields, so I created a multi index using datastore-indexes.xml as below:
<?xml version="1.0" encoding="utf-8"?>
<datastore-indexes autoGenerate="true">
<datastore-index kind=“Data” ancestor="false">
<property name=“subId” direction="asc" />
<property name="expired" direction="asc" />
<property name="claimed" direction="asc" />
</datastore-index>
</datastore-indexes>
This entity is completely a new entity and below are two new records added into the entity kind:
Column : Data
id : 1
subId : 1
expired : false
claimed : false
id : 2
subId : 1
expired : false
claimed : false
However when I try query the Data entity using the below logic, I do get empty data out:
List<Data> data = ofy.load().type( Data.class )
.filter( "subId = ", 1 )
.filter( "expired = ", Boolean.FALSE )
.filter( "claimed = ", Boolean.FALSE )
.list();
PS - I see that index status is currently Serving and I except the data to be retrieved properly. Please help me if am missing anything?