glukkkk
November 19, 2020, 10:53am
1
I’ve examined your course called “Working with JSON attributes”. Suppose my JSON format is the following:
Is there a way to return in query results only those IDs from this JSON where condition MATCH(‘@lang EN’) is applied? Or maybe indexes, like set.1 is matched.
The MATCH()
full text query only matches against Fields . Not attributes.
But can run queries against attributes including JSON. Syntax is a bit convoluted, would be something like
SELECT id, ANY(x.lang = 'EN' FROM x IN lang.set) AS islang FROM index
WHERE MATCH('...') AND islang=1;
Becused needing to look inside what looks like a variable lenght array.
barryhunter:
But can run queries against attributes including JSON. Syntax is a bit convoluted, would be something like
SELECT id, ANY(x.lang = 'EN' FROM x IN lang.set) AS islang FROM index
WHERE MATCH('...') AND islang=1;
How to use this as json ? Can you please make it json and share here
Sergey
June 7, 2023, 10:18am
5
How to use this as json ? Can you please make it json and share here
Just use ANY(x.lang = 'EN' FROM x IN lang.set)
in expressions or script_fields .