Skip to content

Commit

Permalink
Remove quotes from search query to improve search experience and avoi…
Browse files Browse the repository at this point in the history
…d literal searches
  • Loading branch information
polarp authored and vladoohr committed Nov 3, 2020
1 parent 5438c05 commit 2d1e213
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ckanext/knowledgehub/lib/solr.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def _to_pysolr_arg(value):
query['fq'] = []
query['fq'] = _to_pysolr_arg(query['fq'])

# remove quotes from query to avoid literal searches
# i.e. text:"trends funding" -> text:trends funding
q = query.pop('q', 'text:*')
q = q.replace('"', '')
query['q'] = q

return query


Expand Down

0 comments on commit 2d1e213

Please sign in to comment.