[ckan-discuss] Problems with Solr searching inside a Dataset ("can not sort on undefined field: metadata_modified")

Adrià Mercader adria.mercader at okfn.org
Tue Aug 20 11:24:26 BST 2013


Hi Javier,

This looks indeed as a problem with the CKAN Solr schema (not the db
one) not being picked up.

What file do you see if you request
http://localhost:8983/solr/admin/file/?file=schema.xml

Is it the CKAN one? It should begin with <schema name="ckan" version="2.0">

Did you restart jettty (sudo service jetty restart) after creating the symlink?

Hope this helps,

Adrià

On 19 August 2013 22:21, Francisco Javier Huerta Lopez
<fhuertal at sct.gob.mx> wrote:
> Hello all. This is my first post, I just recently installed CKAN. We are
> planning to start using the software in our government agency, and want to
> get a prototype up and running in order to see how our data would show up.
>
> I followed the instructions pretty closely, on Ubuntu 12.04, using the
> package install. I had a couple of issues - nothing major. But when I got to
> the Solr / Postgres part, I had some issues - specifically, with the 2.0
> Schema. I followed the instructions outlined here:
> http://lists.okfn.org/pipermail/ckan-dev/2013-March/004290.html symlinking
> the correct (2.0) file and generating the database using sudo ckan db init
>
> Everything seems fine. I got a SUCCESS ending message.
>
> The problem here is - whenever I do a search on my part, I always get the
> following error on my Apache log:
>
> -----
> [Mon Aug 19 13:51:27 2013] [error] 2013-08-19 13:51:27,249 ERROR
> [ckan.controllers.package] Dataset search error: ('SOLR returned an error
> running query: {\\'sort\\': u\\'score desc, metadata_modified desc\\',
> \\'fq\\': [\\'+dataset_type:dataset capacity:"public" +site_id:"default"
> +state:active\\'], \\'facet.mincount\\': 1, \\'rows\\': 21,
> \\'facet.field\\': [\\'organization\\', \\'groups\\', \\'tags\\',
> \\'res_format\\', \\'license_id\\'], \\'facet.limit\\': \\'50\\', \\'mm\\':
> \\'2<-1 5<80%\\', \\'facet\\': \\'true\\', \\'q\\': u\\'datos\\',
> \\'start\\': 0, \\'wt\\': \\'json\\', \\'qf\\': \\'name^4 title^4 tags^2
> groups^2 text\\', \\'tie\\': \\'0.1\\', \\'fl\\': \\'id data_dict\\',
> \\'defType\\': \\'dismax\\'} Error: \\'can not sort on undefined field:
> metadata_modified\\'',)
> [Mon Aug 19 13:51:27 2013] [error] 2013-08-19 13:51:27,301 INFO
> [ckan.lib.base]  /dataset render time 0.087 seconds
> [Mon Aug 19 13:51:27 2013] [error] 2013-08-19 13:51:27,750 INFO
> [ckan.lib.base]  /api/i18n/en render time 0.004 seconds
> [Mon Aug 19 13:54:24 2013] [error] 2013-08-19 13:54:24,616 ERROR
> [ckan.controllers.package] Dataset search error: ('SOLR returned an error
> running query: {\\'sort\\': u\\'score desc, metadata_modified desc\\',
> \\'fq\\': [\\'+dataset_type:dataset capacity:"public" +site_id:"default"
> +state:active\\'], \\'facet.mincount\\': 1, \\'rows\\': 21,
> \\'facet.field\\': [\\'organization\\', \\'groups\\', \\'tags\\',
> \\'res_format\\', \\'license_id\\'], \\'facet.limit\\': \\'50\\', \\'mm\\':
> \\'2<-1 5<80%\\', \\'facet\\': \\'true\\', \\'q\\': u\\'datos\\',
> \\'start\\': 0, \\'wt\\': \\'json\\', \\'qf\\': \\'name^4 title^4 tags^2
> groups^2 text\\', \\'tie\\': \\'0.1\\', \\'fl\\': \\'id data_dict\\',
> \\'defType\\': \\'dismax\\'} Error: \\'can not sort on undefined field:
> metadata_modified\\'',)
> -----
>
> And I get the following message on my front end:
>
> -----
> Sorry no datasets found for "XXX"
>
> Please try another search.
>
> There was an error while searching. Please try again.
>
> -----
>
>
>
> I mention the Solr schema issue because I believe that's the part where my
> problems started (and the only step where I think I had issues with the
> install). I suppose there's something wrong with my database schema, but
> have no clue as to how to start troubleshooting. Any help will be greatly
> appreciated!
>
>
> Javier.
>
>
>
>
> _______________________________________________
> ckan-discuss mailing list
> ckan-discuss at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-discuss
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-discuss
>



More information about the ckan-discuss mailing list