FTS inside array

While we still need to implement the full object comparison support, I understand the advantages of flexibility that FTS provides ([https://blog.couchbase.com/search-and-rescue-7-reasons-for-n1ql-sql-developers-to-use-search/]).

Here’s somewhat useful idea for you to consider. It’s not perfect, but you can use FTS index as the first round of filter (like a bloom filter), and then apply the filters you need to apply in N1QL. The version below works in 6.5 (beta shortly), in prior versions, you’ll have to use CURL() function.

SELECT *
FROM s
INNER JOIN s s1 ON (META(s).id = META(s1).id)
UNNEST s1.tshirts AS s2
WHERE search(s, "+tshirts.color:blue +tshirts.size:large")
    AND s2.color = "blue"
    AND s2.size = "large" ;
2 Likes