Parcourir la source

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

Romain Rigaux il y a 10 ans
Parent
commit
dfe05d9167
2 fichiers modifiés avec 4 ajouts et 2 suppressions
  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 = {}

Fichier diff supprimé car celui-ci est trop grand
+ 2 - 0
apps/search/src/search/tests.py


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff