I wonder if by adding boolean docvalue to schema, you could use in-place updates to add that information post-indexing by basically running batch checks on documents that don't have that new flag at all and then updating it to be 0/1 to indicate body. The in-place update would avoid having to reindex the data from scratch.
Just brainstorming some other ways to the same "make it boolean" target, never tried it. Regards, Alex. On Wed, 28 Jul 2021 at 13:49, mtn search <search...@gmail.com> wrote: > > 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 <arafa...@gmail.com> > 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 <search...@gmail.com> 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 > >