4
4
import time
5
5
import meilisearch
6
6
from builtins import range
7
- import pyhash
7
+ # import pyhash
8
8
9
9
def remove_bad_encoding (value ):
10
10
return value .replace (''' , "'" )
@@ -37,16 +37,17 @@ def parse_record(record):
37
37
for k , v in record ['hierarchy_radio' ].items ():
38
38
key = 'hierarchy_radio_' + k
39
39
new_hierarchy_radio = {** {key : v }, ** new_hierarchy_radio }
40
- hasher = pyhash .fnv1_32 ()
41
- new_record_url_hash = {}
42
- new_record_url_hash ['url_hash' ] = hasher (record ['url' ])
40
+ # hasher = pyhash.fnv1_32()
41
+ # new_record_url_hash = {}
42
+ # new_record_url_hash['url_hash'] = hasher(record['url'])
43
43
del record ['weight' ]
44
44
del record ['hierarchy' ]
45
45
del record ['hierarchy_radio' ]
46
46
del record ['hierarchy_camel' ]
47
47
del record ['hierarchy_radio_camel' ]
48
48
del record ['content_camel' ]
49
- return {** record , ** new_weight , ** new_hierarchy , ** new_hierarchy_radio , ** new_record_url_hash }
49
+ return {** record , ** new_weight , ** new_hierarchy , ** new_hierarchy_radio }
50
+ # return {**record, **new_weight, **new_hierarchy, **new_hierarchy_radio, **new_record_url_hash}
50
51
51
52
class MeiliSearchHelper :
52
53
"""MeiliSearchHelper"""
@@ -63,7 +64,7 @@ class MeiliSearchHelper:
63
64
"level" ,
64
65
"position"
65
66
],
66
- "distinctField" : "url_hash" ,
67
+ # "distinctField": "url_hash",
67
68
"rankingRules" : {
68
69
"page_rank" : "dsc" ,
69
70
"level" : "dsc" ,
@@ -105,7 +106,7 @@ def update_schema_based_on(self, record):
105
106
base_schema = {
106
107
'anchor' : ['displayed' ],
107
108
'url' : ['displayed' ],
108
- 'url_hash' : ['displayed' , 'ranked' ],
109
+ # 'url_hash': ['displayed', 'ranked'],
109
110
'content' : ['indexed' , 'displayed' ],
110
111
'objectID' : ['identifier' , 'indexed' , 'displayed' ],
111
112
'page_rank' : ['indexed' , 'ranked' ],
0 commit comments