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

Adrià Mercader adria.mercader at okfn.org
Wed Aug 17 10:06:13 UTC 2016


Hi Lucia,

Don't apologise for writing to the list, that's why it is set up!

You can see the exact queries Solr is receiving by looking at the Solr
logs. These will be in:

* Tomcat: /var/log/tomcat7/catalina.out
*Jetty: /var/log/jetty/2016_08_17.stderrout.log

What you describe sounds bizarre, and it might still be a side-effect
of ckanext-hierarchy

Hope this helps,

Adrià

On 17 August 2016 at 10:41,  <lucia.espona at wsl.ch> wrote:
> 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 Datasets
> http://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 Datasets
>
> I 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
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>



More information about the ckan-dev mailing list