[ckan-dev] Problem searching in organization (unrelated to ckanext-hierarchy)

lucia.espona at wsl.ch lucia.espona at wsl.ch
Wed Aug 17 09:41:07 UTC 2016


 Dear all,


Sorry for writing so much, I am still desperate trying to find out why I cannot search for datasets inside the organization read page. If I write something in the search box, result is always zero datasets. I removed ckanext-hierarchy but it doesn't seem to be causing the issue. Here an example:
http://envidat02.wsl.ch:5000/organization/
wsl -> 2 Datasetshttp://envidat02.wsl.ch:5000/organization/
wsl?q=test&sort=score+desc%2C+metadata_modified+desc -> 0 Datasets!!There are matching datasets (public and active):
http://envidat02.wsl.ch:5000/dataset?q=
test&organization=wsl&sort=score+desc%2C+metadata_modified+desc -> 2 DatasetsI went on debugging and came to query.py where the query for Solr is created and the only difference seems to be the 'q' content:

Empty search text:
2016-08-17 11:19:53,333 DEBUG [ckan.lib.search.query] Package query:  {'sort': 'score desc, metadata_modified desc', 'fq': [u'  +site_id:"default" +state:active'], 'facet.mincount': 1, 'rows': 21,  'facet.field': ['organization', 'groups', 'tags', 'res_format',  'license_id'], 'facet.limit': '50', 'facet': 'true', 'q': u'  owner_org:"332fe580-e16f-4e2e-9018-be65e430a3a0"', 'start': 0, 'wt':  'json', 'fl': 'id validated_data_dict'}

2016-08-17 11:19:53,335 DEBUG [ckan.lib.search.query] Package query results count: 2
Search text is "test":
2016-08-17 11:21:09,458 DEBUG [ckan.lib.search.query] Package query: {'sort': u'score desc, metadata_modified desc', 'fq': [u' +site_id:"default" +state:active'], 'facet.mincount': 1, 'rows': 21, 'facet.field': ['organization', 'groups', 'tags', 'res_format', 'license_id'], 'facet.limit': '50', 'facet': 'true', 'q': u'test owner_org:"332fe580-e16f-4e2e-9018-be65e430a3a0"', 'start': 0, 'wt': 'json', 'fl': 'id validated_data_dict'}
2016-08-17 11:21:09,460 DEBUG [ckan.lib.search.query] Package query results count: 0

I tried to do (almost) the same query in Solr directly and there is no problem:
 {  "responseHeader":{     "status":0,     "QTime":0,     "params":{       "q":"test owner_org:\"332fe580-e16f-4e2e-9018-be65e430a3a0\"",       "df":"text",       "indent":"true",       "fl":"id data_dict",       "rows":"20",       "wt":"json"}},   "response":{"numFound":2,"start":0,"docs":[...] ...

Is there a way to get the exact URL of the Solr query that CKAN is requesting?
Does anyone have an idea what else can I do to find out the problem? 

Many thanks in advance, I have no further ideas how to solve this.

Best,
Lucia



_________________________________________________________
Dr. Lucia Espona Pernas

Swiss Federal Institute for Forest, Snow and Landscape Research WSL
Hauptgebäaude Labortrakt (HL C21)
Zürcherstrasse 111
8903 Birmensdorf
Switzerland

+41 44 739 28 71 phone direct
+41 44 739 21 11 reception

www.wsl.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160817/6e3a3f44/attachment-0002.html>


More information about the ckan-dev mailing list