Uploaded image for project: 'Solr Search Provider'
  1. Solr Search Provider
  2. MGNLEESOLR-149

FieldMapping indexer stops if mgnl:page contains the property

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Neutral
    • None
    • 5.2.1, 5.5
    • None
    • Yes

    Description

      Problem

      The logic of the current BasicSolrIndexService stops indexing a property from the fieldMappings if it's found on the node itself. This causes the property to be ignored on all childNodes e.g. Areas and Components.
      See this if-loop.

      Solution

      Don't perfom this if check and always collect the properties of all childNodes and combine those results with the property of the indexed node:

      String nodeType = config.getNodeType() != null ? config.getNodeType() : NodeTypes.Page.NAME;
      Collection<String> childValues = this.getAllTextForNode(config.getWorkspace(), node, key, nodeType);
      if (StringUtils.isNotBlank(value)) {
          childValues.add(value);
      }
      value = Jsoup.parse(StringUtils.join(childValues, ","), value).text();

      This code bases on an additional adaption of the getAllTextForNode(...) method, which should always return an Array, even if it's empty, instead of returning null.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              atuor Antonio Tuor
              Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Task DoD