Skip to content

Commit

Permalink
Merge pull request #7992 from jobec/3.x
Browse files Browse the repository at this point in the history
Allow searching for things like serials, phone numbers, etc
  • Loading branch information
tk0miya committed Jul 26, 2020
2 parents 503cf27 + 4512d27 commit 08912dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sphinx/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def word_filter(self, word: str) -> bool:
len(word) == 0 or not (
((len(word) < 3) and (12353 < ord(word[0]) < 12436)) or
(ord(word[0]) < 256 and (
len(word) < 3 or word in self.stopwords or word.isdigit()
len(word) < 3 or word in self.stopwords
))))


Expand Down
3 changes: 1 addition & 2 deletions sphinx/themes/basic/static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ var Search = {
objectterms.push(tmp[i].toLowerCase());
}

if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] === "") {
if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i] === "") {
// skip this "word"
continue;
}
Expand Down

0 comments on commit 08912dd

Please sign in to comment.