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
When using a full text index on a field if I update a field that is currently null with a value then the full text indexing of the new value throws a NullPointerException. I've put the stack trace below along with example code that demonstrates the issue. I've found this in 3.4.2 I'm wondering if it's possibly related to the fix for #222
Exception in thread "main" java.lang.NullPointerException
at java.base/java.util.StringTokenizer.<init>(StringTokenizer.java:199)
at java.base/java.util.StringTokenizer.<init>(StringTokenizer.java:221)
at org.dizitart.no2.fulltext.BaseTextTokenizer.tokenize(BaseTextTokenizer.java:40)
at org.dizitart.no2.internals.NitriteTextIndexingService.deleteIndex(NitriteTextIndexingService.java:65)
at org.dizitart.no2.internals.IndexingService.refreshIndexEntry(IndexingService.java:206)
at org.dizitart.no2.internals.DataService.update(DataService.java:182)
at org.dizitart.no2.internals.NitriteService.update(NitriteService.java:443)
at org.dizitart.no2.internals.DefaultNitriteCollection.update(DefaultNitriteCollection.java:322)
at scrap.NitriteIndexNull.main(NitriteIndexNull.java:42)
packagescrap;
importjava.io.File;
importorg.dizitart.no2.Document;
importorg.dizitart.no2.IndexOptions;
importorg.dizitart.no2.IndexType;
importorg.dizitart.no2.Nitrite;
importorg.dizitart.no2.NitriteCollection;
importorg.dizitart.no2.NitriteId;
importorg.dizitart.no2.UpdateOptions;
importorg.dizitart.no2.WriteResult;
importorg.dizitart.no2.filters.Filters;
publicclassNitriteIndexNull {
publicstaticvoidmain(String[] args) {
FiledbFile = newFile("/tmp/nitrite.db");
if(dbFile.exists()) {
dbFile.delete();
}
//create databaseNitritenitrite = Nitrite.builder().filePath("/tmp/nitrite.db").openOrCreate();
//create collectionNitriteCollectioncollection = nitrite.getCollection("col");
//add a recordDocumentdoc = Document.createDocument("FIELD1", "ABC");
doc.put("FIELD2", null);
WriteResultresult = collection.update(Filters.eq("FIELD1", "ABC"), doc, UpdateOptions.updateOptions(true, true));
//get the ID Longid = result.iterator().next().getIdValue();
//create an indexed fieldcollection.createIndex("FIELD2", IndexOptions.indexOptions(IndexType.Fulltext));
//get document back outdoc = collection.getById(NitriteId.createId(id));
//insert a null into the fielddoc.put("FIELD2", null);
collection.update(Filters.eq("FIELD1", "ABC"), doc, UpdateOptions.updateOptions(true, true));
//update the null field with an valuedoc.put("FIELD2", "DEF");
collection.update(Filters.eq("FIELD1", "ABC"), doc, UpdateOptions.updateOptions(true, true));
}
}
The text was updated successfully, but these errors were encountered:
Hi,
When using a full text index on a field if I update a field that is currently
null
with a value then the full text indexing of the new value throws aNullPointerException
. I've put the stack trace below along with example code that demonstrates the issue. I've found this in 3.4.2 I'm wondering if it's possibly related to the fix for #222The text was updated successfully, but these errors were encountered: