Thanks Walter, Alex! Yes I regularly use - Search for *:* -body:* . With the size of the Master/Slave deployment and number of shards, in this case the wildcard query timesout... I plan to add some additional fqs, to narrow the scope.
I do not have an immediate option to change the indexing process/schema, but that is a good idea Alex. Matthew On Wed, Jul 28, 2021 at 10:10 AM Alexandre Rafalovitch <[email protected]> wrote: > This (present/absent) condition is there during the indexing time. So, > apply the optimization at the indexing rather than at the search time. > > Have a custom UpdateRequestProcessor chain that will create a boolean > flag that matches "body" presence/absence. > > You can do that with copy, default-value and regex I think, though > there may be more elegant combinations. The goal is that by the time > that copied field hits the schema, it matches a boolean field > definition for most efficiency. > > Regards, > Alex. > > On Wed, 28 Jul 2021 at 11:55, mtn search <[email protected]> wrote: > > > > Hello, > > > > Some documents in my collection have an empty body field. > > "body":"", > > > > I am looking for a query to find docs with a body field with this "empty" > > value. > > > > Normally, I might run with a filter > > fq=-body:* > > > > On this large set of shards that I am querying it times out with the > > wildcard. On smaller sets, it shows when there is no body field. > > > > Other attempts at representing a value of "" in the filter query have not > > worked. > > > > Any tips? > > > > Thanks, > > Matthew >
