On Fri, 11 May 2018, 01:15 Shawn Heisey, <apa...@elyograg.org> wrote:
> On 5/10/2018 11:49 AM, Deepak Goel wrote: > > Sorry but I am unclear about - "What if there is no default value and the > > field does not contain anything"? What does Solr pass on to Lucene? Or is > > the field itself omitted from the document? > > If there is no default value and the field doesn't exist in what's > indexed, then nothing is sent to Lucene for that field. The Lucene index > will have nothing in it for that field. Pro tip: The empty string is > not the same thing as no value. > > > What if I want to query for documents where the field is not used? Is > that > > possible? > > This is the best performing approach for finding documents where a field > doesn't exist: > > q=*:* -field:[* TO *] > Are there any benchmarks for this approach? If not, I can give it a spin. Also wondering if there are any alternative approach (i guess lucene stores data in a inverted field format) > > Summary: all documents, minus those where the field value is in an > all-inclusive range. > > Thanks, > Shawn > >