/** * Creates a geo {@link IndexField} for the given key. * * @param key must not be {@literal null} or empty. * @return */ public static IndexField geo(String key) { return new IndexField(key, null, Type.GEO); }
/** * Returns whether the index is covering exactly the fields given independently of the order. * * @param keys must not be {@literal null}. * @return */ public boolean isIndexForFields(Collection<String> keys) { Assert.notNull(keys, "Collection of keys must not be null!"); List<String> indexKeys = new ArrayList<String>(indexFields.size()); for (IndexField field : indexFields) { indexKeys.add(field.getKey()); } return indexKeys.containsAll(keys); }
/** * Creates a text {@link IndexField} for the given key. * * @since 1.6 */ public static IndexField text(String key, Float weight) { return new IndexField(key, null, Type.TEXT, weight); }
/** * Returns whether the index is covering exactly the fields given independently of the order. * * @param keys must not be {@literal null}. * @return */ public boolean isIndexForFields(Collection<String> keys) { Assert.notNull(keys, "Collection of keys must not be null!"); List<String> indexKeys = new ArrayList<String>(indexFields.size()); for (IndexField field : indexFields) { indexKeys.add(field.getKey()); } return indexKeys.containsAll(keys); }
public static IndexField create(String key, Direction order) { Assert.notNull(order, "Direction must not be null!"); return new IndexField(key, order, Type.DEFAULT); }
/** * Creates a geo {@link IndexField} for the given key. * * @param key must not be {@literal null} or empty. * @return */ public static IndexField geo(String key) { return new IndexField(key, null, Type.GEO); }
/** * Creates a text {@link IndexField} for the given key. * * @since 1.6 */ public static IndexField text(String key, Float weight) { return new IndexField(key, null, Type.TEXT, weight); }
public static IndexField create(String key, Direction order) { Assert.notNull(order, "Direction must not be null!"); return new IndexField(key, order, Type.DEFAULT); }