That looks like a bug to me. In particular, if you remove the "1=1" then things are fine. I'll log a bug for that.
SQL> create table jtc (
2 rn number not null primary key
3 , js clob not null
4 , constraint jtc_json_ck check (js is json)
5 );
Table created.
SQL>
SQL> insert into jtc (rn, js)
2 values (1,'{
3 "address_name": "Empire State Building",
4 "address": "20 W 29th St",
5 "city": "New York",
6 "state": "NY",
7 "postal_code": "10001",
8 "country_code": "USA"
9 }');
1 row created.
SQL>
SQL> commit;
Commit complete.
SQL>
SQL> create search index jtc_dx on jtc (js) for json
2 parameters ('
3 search_on text_value
4 memory 100M
5 sync (on commit)
6 ');
Index created.
SQL>
SQL> select *
2 from jtc
3 where 1=1
4 and ( json_textcontains(js,'$.state','ny%') )
5 and ( json_textcontains(js,'$.address','em%') or json_textcontains(js,'$.address_name','em%') ) ;
RN JS
---------- --------------------------------------------------------------------------------
1 {
"address_name": "Empire State Building",
"address": "20 W 29th St",
SQL>
SQL> select *
2 from jtc
3 where 1=1
4 and ( json_textcontains(js,'$.address','em%') or json_textcontains(js,'$.address_name','em%') )
5 and ( json_textcontains(js,'$.state','ny%') ) ;
no rows selected
SQL>
SQL>
SQL> select *
2 from jtc
3 where ( json_textcontains(js,'$.state','ny%') )
4 and ( json_textcontains(js,'$.address','em%') or json_textcontains(js,'$.address_name','em%') ) ;
RN JS
---------- --------------------------------------------------------------------------------
1 {
"address_name": "Empire State Building",
"address": "20 W 29th St",
SQL>
SQL> select *
2 from jtc
3 where ( json_textcontains(js,'$.address','em%') or json_textcontains(js,'$.address_name','em%') )
4 and ( json_textcontains(js,'$.state','ny%') ) ;
RN JS
---------- --------------------------------------------------------------------------------
1 {
"address_name": "Empire State Building",
"address": "20 W 29th St",
SQL>
To my knowledge, you won't get scoring etc for a SEARCH index, but I *think* it is valid to fall back to standard Text index syntax to some degree.
SQL> select rn, js, score(0)
2 from jtc
3 where contains(js,'USA WITHIN state',0) > 1;
no rows selected
SQL> select rn, js, score(0)
2 from jtc
3 where contains(js,'USA WITHIN country_code',0) > 1;
RN JS
---------- ---------------------------------------------------
SCORE(0)
----------
1 {
"address_name": "Empire State Building",
"address": "20 W 29th St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country_code": "USA"
}
3
I'll double check with the Text team and amend this answer if they have any more info.