Skip to content

Commit

Permalink
Set mm (minimum should match) parameter to improve search experience
Browse files Browse the repository at this point in the history
  • Loading branch information
polarp authored and vladoohr committed Nov 9, 2020
1 parent 2d1e213 commit 11a893a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ckanext/knowledgehub/logic/action/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -1991,6 +1991,12 @@ def package_search(context, data_dict=None):
data_dict = data_dict or {}
data_dict['boost_for'] = user.id
data_dict['include_private'] = True

# https://lucene.apache.org/solr/guide/6_6/the-dismax-query-parser.html#TheDisMaxQueryParser-Themm_MinimumShouldMatch_Parameter
# set default min should match param
# mm: DisMax query parser parameter
data_dict['mm'] = config.get('ckanext.knowledgehub.search.mm', '1<30%')

return ckan_package_search(context, data_dict)


Expand Down

0 comments on commit 11a893a

Please sign in to comment.