[ckan-dev] Preventing CKAN Search Error when Solr special characters are included

Brian Bonnlander bonnland at ucar.edu
Mon Mar 5 23:18:13 UTC 2018


Hi everyone,

We've had a number of CKAN users try to search for strings like "doi:" 
on our CKAN instance.   This is the typical prefix for a Digital Object 
Identifier, which is becoming more common for Digital Assets.


It looks like when this string is not in double-quotes, CKAN treats this 
as a solr query for a field named "doi", which does not exist.

And the user gets back an error message:

"There was an error while searching. Please try again."

Or sometimes we also get back:

"An internal server error occurred"


We're wondering if there is a way to change either our CKAN or Solr 
configuration, so that any text typed by the user will be treated as a 
text string to search for, rather than a potential Solr query.   This 
would be the equivalent of always surrounding the string with 
double-quotes, but without the user's awareness.

We're using CKAN 2.5.2 with Solr 1.4 ( <--  old version, but I haven't 
found much documentation on how to upgrade).   The Solr query parser is 
the default "lucene" parser.


Any guidance or help would be greatly appreciated!


Thanks,

--Brian




More information about the ckan-dev mailing list