Each of my indexed documents has a multi valued field user_ids_ims
that contains user ids to which the document is related. This field may be empty.
<types>
<fieldType name="tint" class="solr.IntPointField" omitNorms="true"/>
</types>
<fields>
<dynamicField name="*_ims" type="tint" multiValued="true"/>
</fields>
I want a filter query for all the documents where user_ids_ims
contains a particular id value, say 42
, or is empty. e.g. for the following documents:
{ id: 'Page 1', user_ids_ims: [] }
{ id: 'Thing 1', user_ids_ims: [19, 24, 92] }
{ id: 'Thing 2', user_ids_ims: [19, 24, 42, 92] }
{ id: 'Thing 7', user_ids_ims: [19, 24, 92] }
How do I use fq
to include the set of documents including Page 1
and Thing 2
?
I can get Page 1
using fq=!user_ids_ims:[* TO *]
I can get Thing 2
using fq=user_ids_ims:(42)