[ckan-dev] Solr/CKAN - Multi-valued theme - facet

Stéphane Lapointe lapointes at ogsl.ca
Thu Nov 3 23:10:26 UTC 2016


Hi,

To translate our CKAN instance, we're using 
ckanext-scheming/ckanext-fluent plugins.

We wanted to add a theming concept to our web site so we declared a 
dataset.json schema which contains

         {
           "field_name": "theme",
           "preset": "multiple_checkbox",
           "label": {
             "fr": "Thème",
             "en": "Theme"
           },
           "choices": [
             {
               "value": "biodiversity",
               "label": {
                 "fr": "Biodiversité",
                 "en": "Biodiversity"
               }
             },
             {
               "value": "marine_conditions",
               "label": {
                 "fr": "Conditions maritimes",
                 "en": "Marine conditions"
               }
             }
           ]
         },

We can add and save dataset with multiple theme, so we're assuming this 
part is set correctly. But, we're having problem adding a facet theme.


After some debugging, we've found that the Solr's response is quite 
strange. Here's what we've added in the Solr schema.xml:

     <field name="theme" type="text" indexed="true" stored="true" 
multiValued="true"/>


When we make a facet query to Solr, this is the response

(...)

     "extras_theme":"[\"*biodiversity*\", \"*marine_conditions*\"]",

(we observe that this is not normal multiValued like we see with tags 
field. It probably should be: "biodiversity, marine_conditions"... We 
don't know if it's plugins' fault. Apparently, the side-effect is that 
something went wrong with parsing)

(...)

       "facet_counts":{
         "facet_queries":{},
         "facet_fields":{
           "theme":*[**
**            "biodivers",1,**
**            "condit",1,**
**            "marin",1,**
**            "marinecondit",1]*},
         "facet_ranges":{},
         "facet_intervals":{},
         "facet_heatmaps":{}}}


Our question: How can we define a parser/analyzer to obtain a response 
like that:

       "facet_counts":{
         "facet_queries":{},
         "facet_fields":{
           "theme":*[**
**            "biodiversity",1,**
**            "marine_condition",1]*},
         "facet_ranges":{},
         "facet_intervals":{},
         "facet_heatmaps":{}}}


Thank you very much.




---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20161103/ad515afa/attachment-0002.html>


More information about the ckan-dev mailing list