inveniosoftware / troubleshooting

DEPRECATED - Use the forum instead:
https://invenio-talk.web.cern.ch
5 stars 4 forks source link

How to create faceted search for a nested field in elasticsearch v6.5.2 #42

Open PSvishnu93 opened 5 years ago

PSvishnu93 commented 5 years ago

Hi, I have a field named schema with nested type. Following is the schema structure for the field schema.

"schema": {
          "type": "nested",
          "properties": {
            "description": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "name": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        }

I want to create faceted search for the fields name and description. I added the below line to 'schema_name': terms_filter('schema.name.keyword') to the app.config['RECORDS_REST_FACETS']. But its not working. So can someone tell me how to create facets for these fields.

lnielsen commented 5 years ago

Do you by chance have you code public? Then it's easier to troubleshoot