Skip to content

Commit 295f91a

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

File tree

5 files changed

+4
-22
lines changed

5 files changed

+4
-22
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from readthedocs.projects.models import Project, HTMLFile
66
from readthedocs.search.faceted_search import ProjectSearch, FileSearch
7-
from .conf import SEARCH_EXCLUDED_FILE
87
from .mixins import RTDDocTypeMixin
98

109
project_conf = settings.ES_INDEXES['project']
@@ -64,6 +63,8 @@ class Meta(object):
6463

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

6869
@classmethod
6970
def faceted_search(cls, query, projects_list=None, versions_list=None, using=None, index=None):
@@ -120,5 +121,5 @@ def get_queryset(self):
120121
# Do not index files that belong to non sphinx project
121122
# Also do not index certain files
122123
queryset = (queryset.filter(project__documentation_type='sphinx')
123-
.exclude(name__in=SEARCH_EXCLUDED_FILE))
124+
.exclude(name__in=self.excluded_files))
124125
return queryset

readthedocs/search/pagination.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33

44
class SearchPagination(PageNumberPagination):
5-
page_size = 10
5+
page_size = 25
66
page_size_query_param = 'page_size'
77
max_page_size = 100

0 commit comments

Comments
 (0)