@@ -130,7 +130,9 @@ def history_query(db: Any, query_model: QueryModel) -> Tuple[str, Json]:
130130 ctx = ArangoQueryContext ()
131131 query = rewrite_query (query_model )
132132 start = f"`{ db .name } _node_history`"
133- cursor , query_str = query_string (db , query , query_model , start , False , ctx , id_column = "id" )
133+ cursor , query_str = query_string (
134+ db , query , query_model , start , False , ctx , id_column = "id" , use_fulltext_index = False
135+ )
134136 last_limit = f" LIMIT { ll .offset } , { ll .length } " if (ll := query .current_part .limit ) else ""
135137 return f"""{ query_str } FOR result in { cursor } { last_limit } RETURN UNSET(result, { unset_props } )""" , ctx .bind_vars
136138
@@ -302,7 +304,7 @@ def view_term(term: Term) -> Tuple[Optional[str], Term]:
302304 else :
303305 ctx .bind_vars .clear ()
304306
305- cursor , query_str = query_string (db , query , query_model , start_cursor , with_edges , ctx )
307+ cursor , query_str = query_string (db , query , query_model , start_cursor , with_edges , ctx , use_fulltext_index = False )
306308 return cursor , qs + query_str
307309
308310
@@ -340,6 +342,7 @@ def query_string(
340342 * ,
341343 outer_merge : Optional [str ] = None ,
342344 id_column : str = "_key" ,
345+ use_fulltext_index : bool = True ,
343346) -> Tuple [str , str ]:
344347 # Note: the parts are maintained in reverse order
345348 query_parts = query .parts [::- 1 ]
@@ -646,6 +649,7 @@ def add_merge_query(mq: MergeQuery, part_result: str) -> None:
646649 ctx ,
647650 outer_merge = merge_crsr ,
648651 id_column = id_column ,
652+ use_fulltext_index = use_fulltext_index ,
649653 )
650654 if mq .only_first :
651655 merge_result += (
@@ -960,7 +964,7 @@ def ft_term(cursor: str, ab_term: Term) -> str:
960964 return q , crs
961965
962966 parts = []
963- ft , remaining = fulltext_term_combine (query_parts [0 ].term )
967+ ft , remaining = fulltext_term_combine (query_parts [0 ].term ) if use_fulltext_index else ( None , query_parts [ 0 ]. term )
964968 fulltext_part , crsr = fulltext (ft , remaining ) if ft else ("" , start_cursor )
965969 for idx , p in enumerate (query_parts ):
966970 part_tuple = part (p , crsr , idx )
0 commit comments