The objects are like this:
{
usertype: 'person', // acceptable values are 'person', 'organization', and 'entity'
data: {
name: 'john doe',
...
},
isComplete: false, // computed at index time
},
{
usertype: 'entity', // acceptable values are 'person', 'organization', and 'entity'
data: {
name: 'ibm',
...
},
isComplete: true, // computed at index time
},
{
usertype: 'organization', // acceptable values are 'person', 'organization', and 'entity'
data: {
name: 'red cross',
...
},
isComplete: false, // computed at index time
}
I want a filter to match:
- all objects that are NOT
usertype:person
- for objects that are
usertype: person
,isComplete
must be true. In other words,(usertype:person AND isComplete:true)
This means the full filter should be: (usertype:person AND isComplete:true) OR NOT usertype:person
, which has the form A OR ( B AND C )
. The problem here is that Algolia doesn’t allow this type of filter for performance reasons.
Any suggestions/solutions for achieving such a filter? Thanks!