Hi Christian, Thanks for the quick response! That query returns the following:
<element name="id" count="2962858"> <text type="integer" count="2962858" min="87908" max="18039985"/> </element> Out of curiosity, is there a way to see index utilization through the DBA web app or via the ClientSession java class [1] instead of the GUI? I'm using the client/server architecture so mainly run queries these ways. Best, Matt On Fri, Apr 29, 2022 at 1:52 PM Christian Grün <christian.gr...@gmail.com> wrote: > Hi Matthew, > > If you run your query on the following document … > > <data> > <element><id>123</id></element> > <element><id>456</id></element> > </data> > > … and if you look into the Info View in the GUI, you will notice that > the index will be utilized: > > Optimized Query: > db:text("data", "DatabaseName")/parent::id/parent::element > > The query optimizer detects that all “data/element/id” elements are > leaf elements (i.e., have a single text child node), and the resulting > query will be rewritten for index. > > Maybe there are “id” elements in your document that are no leaf > elements? Could you share the result of the following query with us? > > > index:facets('data')/*/element[@name='data']/element[@name='element']/element[@name='id'] > > Best, > Christian >