Skip to content

Commit

Permalink
fuzzymatcher: fix fuzzymatcher to remove '~' from prefix match, per c…
Browse files Browse the repository at this point in the history
…hanges from #250
  • Loading branch information
ikreymer committed Oct 13, 2017
1 parent 056aed0 commit f851d4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pywb/warcserver/index/fuzzymatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# ============================================================================
class FuzzyMatcher(object):
DEFAULT_FILTER = ['~urlkey:{0}']
DEFAULT_FILTER = ['urlkey:{0}']
DEFAULT_MATCH_TYPE = 'prefix'
DEFAULT_REPLACE_AFTER = '?'

Expand Down
4 changes: 2 additions & 2 deletions pywb/warcserver/index/test/test_fuzzymatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_params(self, url, actual_url, mime='text/html'):
return params

def get_expected(self, url, mime='text/html', filters=None):
filters = filters or ['~urlkey:']
filters = filters or ['urlkey:']
exp = [{'filter': filters,
'is_fuzzy': True,
'urlkey': canonicalize(url),
Expand Down Expand Up @@ -107,7 +107,7 @@ def test_fuzzy_custom_rule(self):
actual_url = 'http://youtube.com/get_video_info?a=d&html5=true&___abc=125&video_id=ABCD&id=1234'
params = self.get_params(url, actual_url)
cdx_iter, errs = self.fuzzy(self.source, params)
filters = ['~urlkey:html5=true', '~urlkey:video_id=abcd']
filters = ['urlkey:html5=true', 'urlkey:video_id=abcd']
assert list(cdx_iter) == self.get_expected(url=actual_url, filters=filters)

def test_no_fuzzy_custom_rule_video_id_diff(self):
Expand Down

0 comments on commit f851d4b

Please sign in to comment.