Closed fmatthies closed 6 months ago
Do we need both counts? Maybe it is sufficient to just give the number of clustered documents that are stored in Neo4J.
Would be fine by me. I'll change it in the branch I'm working on (#197) accordingly.
There are now two methods, but only the first will be used to display document count on the main page.
@Cacheable("documentCount")
public long count() {
return documentNodeRepository.count();
}
public long textAdaptersDocumentCount() {
return getDocumentQueryService().getTextAdapterConfigs().stream()
.map(
c -> {
try {
TextAdapter adapter = TextAdapter.getInstance(c);
return adapter.count();
} catch (Exception e) {
return 0L;
}
})
.reduce(Long::sum)
.orElse(0L);
}
Right now, the document count is generated over all documents that are found in all (ES) databases that are specified by an adapter:
Maybe it would be feasible to have a second counter, that goes over all
DocumentNode
s in the Neo4j Database; we could display it beside it or somewhere else and one could get an overview that not for allDocument
s a graph representation was created.