1

I wonder is there is a way of querying inverted index by using complex logical operations, like:

find "some_text" from property 'property1' OR 'property2' AND created_at before 'date'

where filter only accepts one operator according to documentation.

Tomasz Plonka
  • 285
  • 4
  • 12

1 Answers1

2

Absolutely, it's explained here

An example based on your question would be:

{
  Get {
    ClassName(
      where: {
        operator: And
        operands: [{
          operator: Or
          operands: [{
            path: ["property"]
            operator: Like
            valueString: "property1"
          }, {
            path: ["property"]
            operator: Like
            valueString: "property2"
          }]
        }, {
          path: ["_creationTimeUnix"]
          operator: LessThan
          valueString: "1664505080008"
        }]
      }
    ) {
      property
      _additional {
        creationTimeUnix
      }
    }
  }
}

PS:
This indeed becomes -as you write- a complex filter ;)

Bob van Luijt
  • 7,153
  • 12
  • 58
  • 101