How about doing that logic at index time? Make a new field, then copy into it 
with that logic using an update request processor.

wunder
Walter Underwood
wun...@wunderwood.org
http://observer.wunderwood.org/  (my blog)


> On Sep 12, 2017, at 2:05 PM, Peter Kirk <p...@alpha-solutions.dk> wrote:
> 
> Hi
> 
> I want to formulate an fq which filters on fields depending on what fields 
> exist in each document.
> 
> For example:
> if the document has a "field1" then use "field1:[1 TO 100]";
> but if there is no "field1", then check if there is a "field2";
> if there is a "field2" then use "field2:[1 TO 100];
> but if there is no "field2", then use "field3:[1 TO 100].
> 
> Something like:
> ?q=*:*&fq=if(exists(field1),field1:[1 TO 100],if(exists(field2),field2:[1 TO 
> 100], field3:[1 TO 100]))
> 
> 
> But is this does not work.
> Is it even possible?
> 
> Thanks,
> Peter

Reply via email to