0

How can I change the query so that I can use two fulltext searches in one query? Under here is a simplified version of my query now. It does not work - it only gives me results from the first FULLTEXT() search.

    FOR doc IN FULLTEXT(@@collection, "this.is.my.path", "prefix:headph") OR  FULLTEXT(@@collection, "antoher.path", "random words")   
RETURN doc
someone
  • 57
  • 4

1 Answers1

1

FULLTEXT() returns an array, which is always true and thus the right-hand side of OR is fully ignored.

What you could do is APPEND(FULLTEXT(…), FULLTEXT(…)) to iterate over both of their result sets. You may also use UNION_DISTINCT() since FULLTEXT() doesn't return results in a particular order anyway.

For a more sophisticated fulltext search engine with ranking see ArangoSearch.

CodeManX
  • 11,159
  • 5
  • 49
  • 70