Skip to content

Commit dc4615e

Browse files
committed
fixup as per review
1 parent 1417f86 commit dc4615e

File tree

4 files changed

+3
-20
lines changed

4 files changed

+3
-20
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,3 @@ notifications:
4343
branches:
4444
only:
4545
- master
46-
- search_upgrade

readthedocs/projects/utils.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,6 @@ def version_from_slug(slug, version):
3232
return v
3333

3434

35-
def find_file(basename, pattern, path):
36-
"""
37-
Recursively find matching file.
38-
39-
:param basename: Basename of a file to match
40-
:param pattern: Pattern to match
41-
:param path: the directory to search for the file
42-
:returns: path of matching file
43-
"""
44-
for root, _, files in os.walk(path):
45-
for filename in files:
46-
file_basename = os.path.splitext(filename)[0]
47-
48-
if fnmatch.fnmatch(filename, pattern) and file_basename == basename:
49-
return os.path.join(root, filename)
50-
51-
5235
def run(*commands):
5336
"""
5437
Run one or more commands.

readthedocs/search/conf.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

readthedocs/search/documents.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class Meta(object):
6464

6565
# Fields to perform search with weight
6666
search_fields = ['title^10', 'headers^5', 'content']
67+
# Exclude some files to not index
68+
excluded_files = ['search.html', 'genindex.html', 'py-modindex.html']
6769

6870
@classmethod
6971
def faceted_search(cls, query, projects_list=None, versions_list=None, using=None, index=None):
@@ -120,5 +122,5 @@ def get_queryset(self):
120122
# Do not index files that belong to non sphinx project
121123
# Also do not index certain files
122124
queryset = (queryset.filter(project__documentation_type='sphinx')
123-
.exclude(name__in=SEARCH_EXCLUDED_FILE))
125+
.exclude(name__in=self.excluded_files))
124126
return queryset

0 commit comments

Comments
 (0)