Description
N1fty supports flex index in ARRAYs.
INSERT INTO default VALUES ("airline_002", {"airline":"AF","airlineid":"airline_002","destinationairport":"SJC","distance":481.617376098415,"equipment":"320","id":2, "sourceairport":"LAX", "schedule":[{"day":0,"flight":"AF198","utc":"10:13:00"}, {"day":1,"flight":"AF250","utc":"12:59:00"}, {"day":2,"flight":"AF223","utc":"19:41:00"}], |
"special_flights" : [ {"flight" : "AF444", "utc" : "4:44:44"}, {"flight" : "AF333", "utc" : "3:33:33"} ] }); |
|
SELECT META(d).id
|
FROM default AS d |
WHERE d.airline = "AF" |
AND ANY s, sf IN d.schedule, d.special_flights SATISFIES s.day > 1 AND sf.flight = "AF444" END; |
See if the following use can be added.
If you look ANY clause has two arrays, two binding variables. both uses same position of array
This same as
|
for i = 0; i < length(schedule) && i < length(special_flights); i++ ) { |
s = schedule[i]
|
sf = special_flights[i]
|
}
|
As FTS doesn't know position of element that is fine, let N1QL handle during evaluation. As far as FTS search is concern treat them separate any clause sargable.
If Index has either special_flights or schedule or both it should able to do.