'Flowpack.SearchPlugin:SuggestableMixin':
  abstract: true
  properties:
    '__suggestions':
      search:
        elasticSearchMapping:
          type: completion
          payloads: true
          context:
            workspace:
              type: category
              path: '__workspace'
            parentPath:
              type: category
              path: '__parentPath'
            dimensionCombinationHash:
              type: category
              path: '__dimensionCombinationHash'
        indexing: "${Flowpack.SearchPlugin.Suggestion.build(q(node).property('title'), q(node).is('[instanceof Neos.Neos:Document]') ? node.identifier : q(node).parents('[instanceof Neos.Neos:Document]').get(0).identifier, {nodeIdentifier: node.identifier}, 20)}"

'Flowpack.SearchPlugin:AutocompletableMixin':
  abstract: true
  properties:
    '__completion':
      search:
        elasticSearchMapping:
          type: string
          analyzer: autocomplete
        indexing: "${String.stripTags(q(node).property('title'))}"

'Flowpack.SearchPlugin:SuggestableMixin':
  abstract: true
  properties:
    '__suggestions':
      search:
        elasticSearchMapping:
          type: completion
          payloads: true
          context:
            workspace:
              type: category
              path: '__workspace'
            parentPath:
              type: category
              path: '__parentPath'
            dimensionCombinationHash:
              type: category
              path: '__dimensionCombinationHash'
        indexing: "${Flowpack.SearchPlugin.Suggestion.build(q(node).property('title') ? q(node).property('title') : '', q(node).is('[instanceof Neos.Neos:Document]') ? node.identifier : q(node).parents('[instanceof Neos.Neos:Document]').get(0).identifier, {nodeIdentifier: node.identifier}, 20)}"

'Flowpack.SearchPlugin:AutocompletableMixin':
  abstract: true
  properties:
    '__completion':
      search:
        elasticSearchMapping:
          type: string
          analyzer: autocomplete
        indexing: "${String.stripTags(q(node).property('title'))}"

Handle null title in suggestion indexing
BUGFIX: Handle null title in suggestion indexing

If the `title` has a `null` value for some reason, the helper will throw
an exception. This avoids that by passing an empty string instead.