Database with millions of JSON records for example:
{
title: “book title”,
isbn: [“0345296265”, “9780345296265”],
type: “meta”
}
Goal to search for records that contain ISBN 0345296265
CREATE INDEX index_isbn ON BooksDB
( DISTINCT ARRAY i
FOR i IN isbn
END) WHERE type
= “meta”
SELECT * from BooksDB
WHERE type = “meta” AND (ANY i IN isbn SATISFIES i = “0345296265” END)
Returns in 1ms without error but an empty result none found. Is there a better way to index/search arrays?