@@ -270,13 +270,8 @@ def view_term(term: Term) -> Tuple[Optional[str], Term]:
270270 # we filter the list down as much as possible, but leave the context term untouched
271271 is_array_context = bool (array_marker .search (term .name ))
272272 context_in_array = context_in_array or is_array_context
273- # arangosearch view does not handle nested array searches correctly
274- # see: https://github.com/arangodb/arangodb/issues/21281
275- # once this is resolved we can enable the next 3 lines
276- #
277- # sp, ct = view_term(term.predicate_term())
278- # return sp, term if is_array_context else ct
279- return (None , term ) if is_array_context else view_term (term .predicate_term ())
273+ sp , ct = view_term (term .predicate_term ())
274+ return sp , term if is_array_context else ct
280275 elif isinstance (term , IdTerm ):
281276 if len (term .ids ) == 1 :
282277 sp = f"{ crs } ._key == @{ ctx .add_bind_var (term .ids [0 ])} "
@@ -301,6 +296,12 @@ def view_term(term: Term) -> Tuple[Optional[str], Term]:
301296 return None , term
302297 return combine_optional (lsp , rsp , lambda ll , rr : f"({ ll } { term .op } { rr } )" ), lt .combine (term .op , rt )
303298 elif isinstance (term , Predicate ):
299+ # arangosearch view does not handle nested array searches correctly
300+ # see: https://github.com/arangodb/arangodb/issues/21281
301+ # once this is resolved we can delete the next 2 lines
302+ if term .op in ["!=" , "not in" ] and bool (array_marker .search (term .name )):
303+ return "true" , term # true will not filter anything leaving the term for the filter
304+
304305 return predicate_term (term )
305306 else :
306307 return None , term
0 commit comments