@@ -3531,35 +3531,25 @@ def _maybe_dict(val: Any) -> Dict[str, Any]:
35313531
35323532 model_name = os .environ .get ("EMBEDDING_MODEL" , "BAAI/bge-base-en-v1.5" )
35333533 model = _get_embedding_model (model_name )
3534- prev_coll = os .environ .get ("COLLECTION_NAME" )
3535- try :
3536- os .environ ["COLLECTION_NAME" ] = coll
3537- items2 = run_hybrid_search (
3538- queries = queries ,
3539- limit = int (code_limit ),
3540- per_path = int (per_path_val ),
3541- language = language or None ,
3542- under = under or None ,
3543- kind = kind or None ,
3544- symbol = symbol or None ,
3545- ext = ext or None ,
3546- not_filter = not_ or None ,
3547- case = case or None ,
3548- path_regex = path_regex or None ,
3549- path_glob = path_glob or None ,
3550- not_glob = not_glob or None ,
3551- expand = str (os .environ .get ("HYBRID_EXPAND" , "0" )).strip ().lower ()
3552- in {"1" , "true" , "yes" , "on" },
3553- model = model ,
3554- )
3555- finally :
3556- if prev_coll is None :
3557- try :
3558- del os .environ ["COLLECTION_NAME" ]
3559- except Exception :
3560- pass
3561- else :
3562- os .environ ["COLLECTION_NAME" ] = prev_coll
3534+ items2 = run_hybrid_search (
3535+ queries = queries ,
3536+ limit = int (code_limit ),
3537+ per_path = int (per_path_val ),
3538+ language = language or None ,
3539+ under = under or None ,
3540+ kind = kind or None ,
3541+ symbol = symbol or None ,
3542+ ext = ext or None ,
3543+ not_filter = not_ or None ,
3544+ case = case or None ,
3545+ path_regex = path_regex or None ,
3546+ path_glob = path_glob or None ,
3547+ not_glob = not_glob or None ,
3548+ expand = str (os .environ .get ("HYBRID_EXPAND" , "0" )).strip ().lower ()
3549+ in {"1" , "true" , "yes" , "on" },
3550+ model = model ,
3551+ collection = coll ,
3552+ )
35633553 if isinstance (items2 , list ):
35643554 for obj in items2 :
35653555 if isinstance (obj , dict ):
0 commit comments