Class IndexUtils


  • public final class IndexUtils
    extends Object
    Set of index-related utility methods.
    • Method Detail

      • setReady

        public static void setReady​(SitePaths sitePaths,
                                    String name,
                                    int version,
                                    boolean ready)
        Mark an index version as ready to serve queries.
      • accountFields

        public static Set<String> accountFields​(QueryOptions opts,
                                                boolean useLegacyNumericFields)
        Returns a sanitized set of fields for account index queries by removing fields that the current index version doesn't support and accounting for numeric vs. string primary keys. The primary key situation is temporary and should be removed after the migration is done.
      • accountFields

        public static Set<String> accountFields​(Set<String> fields,
                                                boolean useLegacyNumericFields)
        Returns a sanitized set of fields for account index queries by removing fields that the current index version doesn't support and accounting for numeric vs. string primary keys. The primary key situation is temporary and should be removed after the migration is done.
      • changeFields

        public static Set<String> changeFields​(QueryOptions opts,
                                               boolean useLegacyNumericFields)
        Returns a sanitized set of fields for change index queries by removing fields that the current index version doesn't support and accounting for numeric vs. string primary keys. The primary key situation is temporary and should be removed after the migration is done.
      • groupFields

        public static Set<String> groupFields​(QueryOptions opts)
        Returns a sanitized set of fields for group index queries by removing fields that the index doesn't support and accounting for numeric vs. string primary keys. The primary key situation is temporary and should be removed after the migration is done.
      • describe

        public static String describe​(CurrentUser user)
        Returns a index-friendly representation of a CurrentUser to be used in queries.
      • projectFields

        public static Set<String> projectFields​(QueryOptions opts)
        Returns a sanitized set of fields for project index queries by removing fields that the index doesn't support.