From b592289055cb7a91f805fc2b48a2c7adcb94f04d Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Sat, 26 Oct 2013 18:08:25 -0700 Subject: [PATCH] Add routing to page search --- readthedocs/restapi/views.py | 2 +- readthedocs/search/indexes.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/readthedocs/restapi/views.py b/readthedocs/restapi/views.py index 11d84b59c12..a2d7267f839 100644 --- a/readthedocs/restapi/views.py +++ b/readthedocs/restapi/views.py @@ -202,7 +202,7 @@ def search(request): } } } - results = PageIndex().search(body) + results = PageIndex().search(body, routing=project_id) else: body = { diff --git a/readthedocs/search/indexes.py b/readthedocs/search/indexes.py index 20aa467a7cc..2a5873c635b 100644 --- a/readthedocs/search/indexes.py +++ b/readthedocs/search/indexes.py @@ -181,9 +181,9 @@ def update_aliases(self, new_index, delete=True): if delete and old_index: self.es.indices.delete(index=old_index) - def search(self, body): + def search(self, body, **kwargs): return self.es.search(index=self._index, doc_type=self._type, - body=body) + body=body, **kwargs) class Project(Index):