Hi,
after Andreas recommended using index:facets(), my application speeds up.
However, I don't think that this is the best solution. The database, I apply this function to is changing constantly. As the function is using the index, I would have to re-create the index first, is this correct? So that the functions would give wrong results most of the time.
And I found another strange thing: I had to delete some nodes and re-created all indexes. However, index:facets() still gives the information from the status *before* the deletion, i.e., it counts nodes that aren't there anymore. Therefore I don't use it.
count(//entry/selected[text () = "yes"])
gives the correct result,
index:facets("collect", "flat")//element[@name = "selected"]/entry[text() = "yes"]/@count/data()
still gives the wrong result, i.e., the result that was correct some days ago.
Is this a bug or a feature?
Best regards
Cerstin