Uploaded image for project: 'PUBLIC - Liferay Documentation'
  1. PUBLIC - Liferay Documentation
  2. LRDOCS-8675

How to use Custom Fields (expando, searchable as keyword) in Custom Facet example (nested, .raw)

    Details

      Description

      Tasks:

      1. Add example to the Custom Facet article to show how to use Custom Fields (steps below)
      2. Promote Field Mappings UI for finding fields
      3. Talk about using Elasticsearch's Raw fields

      To show how to use Custom Fields:

      1. Create a Custom Field for Web Content of type true/false, searchable as keyword called enabled
      2. Field name in index:
        expando__keyword__custom_fields__enabled
        
      1. Field mapping in Elasticsearch:
        GET /liferay-20098/_mapping/field/expando__keyword__custom_fields__enabled
        
        {
          "liferay-20098": {
            "mappings": {
              "expando__keyword__custom_fields__enabled": {
                "full_name": "expando__keyword__custom_fields__enabled",
                "mapping": {
                  "expando__keyword__custom_fields__enabled": {
                    "type": "text",
                    "store": true,
                    "fields": {
                      "raw": {
                        "type": "keyword"
                      }
                    },
                    "analyzer": "keyword_lowercase"
                  }
                }
              }
            }
          }
        }
        

      As you can see, Custom Fields are indexed in a nested form:

      • expando__keyword__custom_fields__enabled

        : as text

      • expando__keyword__custom_fields__enabled.raw

        : as keyword => Use this in the Custom Facet widget configuration

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tibor.lipusz Tibor Lipusz
              Reporter:
              tibor.lipusz Tibor Lipusz
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Zendesk Support

                    Packages

                    Version Package
                    7.1.x
                    7.2.x
                    7.3.x