Skip to content
Snippets Groups Projects
Commit 62fe7cbe262d authored by Arthur Lutz's avatar Arthur Lutz
Browse files

[views] set index-name in facetedsearch

parent 9575714a94be
No related branches found
No related tags found
No related merge requests found
......@@ -103,7 +103,6 @@
if locations and index_name:
# TODO sanitize locations
es = connections.create_connection(hosts=locations.split(','),
index=index_name,
timeout=20)
try:
if not es.indices.exists(index=index_name):
......
......@@ -39,7 +39,9 @@
'creation_date': DateHistogramFacet(field='creation_date', interval='month'),
}
def __init__(self, query=None, filters={}, doc_types=None):
def __init__(self, query=None, filters={}, doc_types=None, index=None):
if index:
self.index = index
if doc_types:
self.doc_types = doc_types
super(CWFacetedSearch, self).__init__(query, filters)
......@@ -115,6 +117,7 @@
indexable = indexable_types(self._cw.vreg.schema)
return CWFacetedSearch(query_string,
facet_selections,
index=self._cw.vreg.config.get('index-name'),
doc_types=indexable)[start:stop]
def display_results(self, response):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment