Skip to content

Commit

Permalink
do not break search query for autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Dec 6, 2018
1 parent 937948a commit cf73331
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ckan/config/solr/schema.xml
Expand Up @@ -84,12 +84,12 @@ schema. In this case the version should be set to the next CKAN version number.

<fieldType name="text_ngram" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.NGramTokenizerFactory" minGramSize="2" maxGramSize="10"/>
<filter class="solr.LowerCaseFilterFactory"/>
<tokenizer class="solr.NGramTokenizerFactory" minGramSize="2" maxGramSize="10"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.EdgeNGramTokenizerFactory" minGramSize="2" maxGramSize="10"/>
<filter class="solr.LowerCaseFilterFactory"/>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>

Expand Down
2 changes: 1 addition & 1 deletion ckan/tests/legacy/logic/test_action.py
Expand Up @@ -130,7 +130,7 @@ def test_02_package_autocomplete_match_name(self):
assert_equal(res_obj['result'][0]['match_displayed'], 'warandpeace')

def test_02_package_autocomplete_match_title(self):
postparams = '%s=1' % json.dumps({'q':'a%20w', 'limit': 5})
postparams = '%s=1' % json.dumps({'q': 'won', 'limit': 5})
res = self.app.post('/api/action/package_autocomplete', params=postparams)
res_obj = json.loads(res.body)
assert_equal(res_obj['success'], True)
Expand Down

0 comments on commit cf73331

Please sign in to comment.