Skip to content

Commit 4778c40

Browse files
author
Michał Bielawski
committed
Moved {!geofilt} from q to fq, fixes filtering.
1 parent 96a5ad0 commit 4778c40

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

haystack/backends/solr_backend.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,15 +478,18 @@ def run(self, spelling_query=None):
478478
if self.query_facets:
479479
kwargs['query_facets'] = self.query_facets
480480

481+
if self.spatial_query:
482+
kwargs.update(self.spatial_query.items())
483+
if not self.narrow_queries:
484+
self.narrow_queries = set()
485+
self.narrow_queries.add('{!geofilt}')
486+
#final_query = '{!geofilt}%s' % final_query
487+
481488
if self.narrow_queries:
482489
kwargs['narrow_queries'] = self.narrow_queries
483490

484491
if spelling_query:
485492
kwargs['spelling_query'] = spelling_query
486-
487-
if self.spatial_query:
488-
kwargs.update(self.spatial_query.items())
489-
final_query = '{!geofilt}%s' % final_query
490493

491494
results = self.backend.search(final_query, **kwargs)
492495
self._results = results.get('results', [])

0 commit comments

Comments
 (0)