ckan / ideas

[DEPRECATED] Use the main CKAN repo Discussions instead:
https://github.com/ckan/ckan/discussions
40 stars 2 forks source link

Handeling of search within groups in the groups controller #230

Closed sabinem closed 5 years ago

sabinem commented 5 years ago

On our CKAN istallation search within does not work as expected, see issue: https://github.com/ckan/ckan/issues/4917

I researched the topic and ask a Solr specialist in our company. The problem he sees starts when the query parameters are build up in the groups.py controller:

When you query for a field within a group: say 'Stadtplan' in the group 'umwelt': 'q' is set in the groups.py controller to u'Stadtplan + groups:"umwelt'. This causes that the query comes back empty.

The solr expert suggested to me that the group here is a filter and should such be added to the fq parameter instead.

I feel the search logic for groups is hard to understand in this and it is really hard to overwrite it, since the Group Controller does a lot of things.

I could get the search to work by patching the lib.search.query and using edismax instead of dismax when performing the query on solr. But I want to discuss the general approach for CKAN search in groups here, since I think there is improvement needed in this part of CKAN.

I also want to understand the approach that has been taken. Why is the group added to the q parameter rather then to the fq paramter for the solr-query?

sabinem commented 5 years ago

I just saw that this got fixed in version 2.8. Therefore I am closing this again.