Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quirks with Solr6 #3510

Closed
TkTech opened this issue Mar 28, 2017 · 2 comments · Fixed by #4376
Closed

Quirks with Solr6 #3510

TkTech opened this issue Mar 28, 2017 · 2 comments · Fixed by #4376
Assignees

Comments

@TkTech
Copy link
Member

TkTech commented Mar 28, 2017

Some quirks with CKAN and up-to-date versions of Solr:

  • default field in the schema is deprecated: [ckan] default search field in schema is text. WARNING: Deprecated,​ please use 'df' on request instead.
  • When multiple terms are provided (like an org filter) the field name to search must be explicit. This is currently breaking searching for terms within an organization (q=test +owner_org:... fails, q=text:test +owner_org:... works, q=test works).
  • While we're here, owner org should be a filter not part of the query.
@TkTech TkTech added the Bug label Mar 28, 2017
@TkTech
Copy link
Member Author

TkTech commented Mar 28, 2017

For point 2, a very small change should be forward and backwards compatible and safe for back-porting. Ex:

diff --git a/ckan/controllers/group.py b/ckan/controllers/group.py
index 087209f..912c402 100644
--- a/ckan/controllers/group.py
+++ b/ckan/controllers/group.py
@@ -236,6 +236,9 @@ class GroupController(base.BaseController):
                    'for_view': True, 'extras_as_string': True}

         q = c.q = request.params.get('q', '')
+        if q is not None and q.strip():
+            q = 'text:{q}'.format(q=q)
+
         # Search within group
         if c.group_dict.get('is_organization'):
             q += ' owner_org:"%s"' % c.group_dict.get('id')

janaslo added a commit to singularita/install-ckan that referenced this issue Mar 31, 2017
Because current versions break CKAN search - reported for Solr 6
here: ckan/ckan#3510, I got same errors
with Solr 5.5.4.
@Cheomm88
Copy link
Contributor

Cheomm88 commented Apr 3, 2018

Is solR 6.0.0 supported with CKAN 2.7.2 ?

I'm getting this error:

[Reason: sort param field can't be found: metadata_modified] [Tue Apr
03 15:56:11.881767 2018] [:error] [pid 10485] 2018-04-03 15:56:11,881
ERROR [ckan.controllers.package] Dataset search error: ('SOLR returned
an error running query: {\'sort\': \'score desc, metadata_modified
desc\', \'fq\': [u\'+dataset_type:dataset\',
u\'+site_id:"default"\', \'+state:active\',
u\'+permission_labels:("public")\'], \'facet.mincount\': 1,
\'rows\': 21, \'facet.field\': [u\'organization\',
u\'groups\', u\'tags\', u\'res_format\', u\'license_id\'],
\'facet.limit\': \'50\', \'facet\': \'true\', \'q\':
\':\', \'start\': 0, \'wt\': \'json\', \'fl\': \'id
validated_data_dict\'} Error: SolrError(u"Solr responded with an
error (HTTP 400): [Reason: sort param field can\'t be found:
metadata_modified]",)',) [Tue Apr 03 15:56:11.934996 2018] [:error]
[pid 10485] 2018-04-03 15:56:11,934 INFO [ckan.lib.base] /dataset
render time 0.084 seconds [Tue Apr 03 15:56:12.445289 2018] [:error]
[pid 10485] 2018-04-03 15:56:12,445 INFO [ckan.lib.base]
/api/i18n/en render time 0.006 seconds

I read in stack overflow to downgrade the solR to v5.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants