File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -92,17 +92,22 @@ def ajax(resource_view_id: str):
9292 v = str (request .form [u'columns[%d][search][value]' % i ])
9393 if v :
9494 k = str (request .form [u'columns[%d][name]' % i ])
95+ # (canada fork only): disable FTS wildcarding
96+ # https://github.com/ckan/ckan/issues/8583
9597 # replace non-alphanumeric characters with FTS wildcard (_)
96- v = re .sub (r'[^0-9a-zA-Z\-]+' , '_' , v )
98+ # v = re.sub(r'[^0-9a-zA-Z\-]+', '_', v)
9799 # append ':*' so we can do partial FTS searches
98- colsearch_dict [k ] = v + u' :*'
100+ colsearch_dict [k ] = f' { v } :*'
99101 i += 1
100102
101103 if colsearch_dict :
102104 search_text = json .dumps (colsearch_dict )
103105 else :
104- search_text = re .sub (r'[^0-9a-zA-Z\-]+' , '_' ,
105- search_text ) + u':*' if search_text else u''
106+ # (canada fork only): disable FTS wildcarding
107+ # https://github.com/ckan/ckan/issues/8583
108+ # search_text = re.sub(r'[^0-9a-zA-Z\-]+', '_',
109+ # search_text) + u':*' if search_text else u''
110+ search_text = f'{ search_text } :*' if search_text else ''
106111
107112 try :
108113 response = datastore_search (
You can’t perform that action at this time.
0 commit comments