You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add official null support with indexMissing and indexEmpty options (#527)
Implement INDEXMISSING and INDEXEMPTY support for enhanced null/empty value queries:
- Add indexMissing and indexEmpty parameters to @indexed and @searchable annotations
- Update repository queries to use ismissing() when indexMissing=true, with fallback to exists()
- Support TAG and TEXT fields for both options, NUMERIC fields for indexMissing only
- Requires Redis Stack 2.10+ for full functionality with automatic version detection
- Add comprehensive documentation with examples and version requirements
Copy file name to clipboardExpand all lines: docs/content/modules/ROOT/pages/index-annotations.adoc
+66Lines changed: 66 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -259,6 +259,72 @@ public class Company {
259
259
* `maxTextFields` - Whether to index all text fields (default: false)
260
260
* `temporaryIndex` - Create temporary index (default: false)
261
261
262
+
== Advanced Null and Empty Value Indexing
263
+
264
+
=== IndexMissing and IndexEmpty Support
265
+
266
+
Redis OM Spring supports advanced null and empty value indexing using the `indexMissing` and `indexEmpty` parameters, which leverage Redis Query Engine's INDEXMISSING and INDEXEMPTY features:
List<Product> findByCategoryIsNull(); // Matches both null and empty strings
323
+
}
324
+
----
325
+
326
+
NOTE: The `indexMissing` and `indexEmpty` options provide more accurate null/empty value queries compared to the legacy `exists()` approach, especially for distinguishing between null values and missing fields.
327
+
262
328
== Best Practices
263
329
264
330
* **Use `@Indexed` for most cases** - It auto-detects the appropriate index type
0 commit comments