소스 검색

[search] Support highlighting on records with ids containing binary values

Romain Rigaux 10 년 전
부모
커밋
dfe05d9
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      apps/search/src/search/models.py
  2. 2 0
      apps/search/src/search/tests.py

+ 2 - 2
apps/search/src/search/models.py

@@ -825,8 +825,8 @@ def augment_solr_response(response, collection, query):
     id_field = collection.get('idField')
     if id_field:
       for doc in response['response']['docs']:
-        if id_field in doc and str(doc[id_field]) in highlighted_fields:
-          highlighting = response['highlighting'][str(doc[id_field])]
+        if id_field in doc and smart_unicode(doc[id_field]) in highlighted_fields:
+          highlighting = response['highlighting'][smart_unicode(doc[id_field])]
 
           if highlighting:
             escaped_highlighting = {}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 0
apps/search/src/search/tests.py


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.