@@ -122,6 +122,7 @@ public void doWithPersistentProperty(RedisPersistentProperty persistentProperty)
122
122
Object propertyValue = accessor .getProperty (persistentProperty );
123
123
124
124
if (propertyValue == null ) {
125
+ indexes .addAll (resolveIndex (keyspace , currentPath , persistentProperty , null ));
125
126
return ;
126
127
}
127
128
@@ -212,21 +213,32 @@ protected Set<IndexedData> resolveIndex(String keyspace, String propertyPath,
212
213
213
214
IndexedData indexedData = null ;
214
215
if (transformedValue == null ) {
215
- indexedData = new RemoveIndexedData (indexedData );
216
+
217
+ indexedData = new RemoveIndexedData (new IndexedData () {
218
+ @ Override
219
+ public String getIndexName () {
220
+ return indexDefinition .getIndexName ();
221
+ }
222
+
223
+ @ Override
224
+ public String getKeyspace () {
225
+ return indexDefinition .getKeyspace ();
226
+ }
227
+ });
216
228
} else {
217
229
indexedData = indexedDataFactoryProvider .getIndexedDataFactory (indexDefinition ).createIndexedDataFor (value );
218
230
}
219
231
data .add (indexedData );
220
232
}
221
233
}
222
234
223
- else if (property != null && property .isAnnotationPresent (Indexed .class )) {
235
+ else if (property != null && value != null && property .isAnnotationPresent (Indexed .class )) {
224
236
225
237
SimpleIndexDefinition indexDefinition = new SimpleIndexDefinition (keyspace , path );
226
238
indexConfiguration .addIndexDefinition (indexDefinition );
227
239
228
240
data .add (indexedDataFactoryProvider .getIndexedDataFactory (indexDefinition ).createIndexedDataFor (value ));
229
- } else if (property != null && property .isAnnotationPresent (GeoIndexed .class )) {
241
+ } else if (property != null && value != null && property .isAnnotationPresent (GeoIndexed .class )) {
230
242
231
243
GeoIndexDefinition indexDefinition = new GeoIndexDefinition (keyspace , path );
232
244
indexConfiguration .addIndexDefinition (indexDefinition );
0 commit comments