سؤال

This is how my entity class looks:

@Entity
@Unindexed
public class User {
    ...
    @Indexed
    private int betsCount = 0;

This is how I build/run the query:

objectify.query(User.class).filter("betsCount >", MIN_BETS).iterator()

The index is not being added to datastore-indexes-auto.xml, therefore I can not see it in the dev-console, and naturally the queries (when run on live servers) return nothing.

I know I could add the index (request it to be created) manually but so far automatic creating of indexes seemed to work perfectly for me. So I am wondering what am I missing here.

UPDATE: I did not realize I have to reinsert data when adding @Indexed annotation to existing property.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top