|
31 | 31 | omit_if_exists_in_param, equivalency_map_types_param, search_from_latest_repo_header) |
32 | 32 | from core.common.tasks import delete_concept, make_hierarchy |
33 | 33 | from core.common.throttling import ThrottleUtil |
34 | | -from core.common.utils import to_parent_uri_from_kwargs, generate_temp_version, get_truthy_values, to_int |
| 34 | +from core.common.utils import to_parent_uri_from_kwargs, generate_temp_version, get_truthy_values, to_int, drop_version |
35 | 35 | from core.common.views import SourceChildCommonBaseView, SourceChildExtrasView, \ |
36 | 36 | SourceChildExtraRetrieveUpdateDestroyView, BaseAPIView |
37 | 37 | from core.concepts.constants import PARENT_VERSION_NOT_LATEST_CANNOT_UPDATE_CONCEPT |
@@ -833,6 +833,10 @@ def filter_queryset(self, _=None): # pylint: disable=too-many-locals,too-many-s |
833 | 833 | reranker = reranker and self.request.user.is_mapper_cross_encoder_group |
834 | 834 | score_to_sort = 'search_rerank_score' if reranker else 'search_normalized_score' |
835 | 835 | cid = get_cid() |
| 836 | + is_bridge = (repo_params.get('owner', None) == 'CIEL' and repo_params.get('source', None) == 'CIEL' and |
| 837 | + filters.get('target_repo', None) and |
| 838 | + drop_version(filters.get('target_repo', None)) != '/orgs/CIEL/sources/CIEL/') |
| 839 | + algorithm = ('ocl-ciel-bridge' if is_bridge else 'ocl-semantic') if is_semantic else 'ocl-search' |
836 | 840 | results = [] |
837 | 841 | for row in rows: |
838 | 842 | start_time = time.time() |
@@ -860,6 +864,7 @@ def filter_queryset(self, _=None): # pylint: disable=too-many-locals,too-many-s |
860 | 864 | serializer = ConceptDetailSerializer if self.is_verbose() else ConceptMinimalSerializer |
861 | 865 | data = serializer(concept, context={'request': self.request}).data |
862 | 866 | data['search_meta']['search_normalized_score'] = normalized_score * 100 |
| 867 | + data['search_meta']['algorithm'] = algorithm |
863 | 868 | result['results'].append(data) |
864 | 869 | print(f"[{cid}] Concepts serialized in {time.time() - start_time} seconds") |
865 | 870 | start_time = time.time() |
|
0 commit comments