Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-22610

Improve HighlightJsonEnricher way of serving highlights

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.1
    • Fix Version/s: 9.2
    • Component/s: Elasticsearch

      Description

      It currently serve the highlights like:

      {
          "highlight": {
              "dc:description": [
                  "<em>fox</em>"
              ], 
              "dc:description.fulltext": [
                  "<em>fox</em>"
              ], 
              "dc:title": [
                  "<em>fox</em>"
              ], 
              "dc:title.fulltext": [
                  "<em>fox</em>"
              ], 
              "ecm:name": [
                  "<em>fox</em>"
              ], 
              "ecm:path@level4": [
                  "<em>fox</em>"
              ], 
              "ecm:title": [
                  "<em>fox</em>"
              ]
          }
      }
      

      which is not handy to manipulate client side and not maintainable/extendible in the furture if we'd like to add more info about a given highlight (weight, etc.)

      {
          "highlight": [
              {
                  "field": "dc:description.fulltext", 
                  "segments": [
                      " man were lurking in the\n\nshadows ahead, the wind would carry the smell of that\n\nman to Mr <em>Fox\u00e2\u20ac\u2122s</em> nose", 
                      " there was a hole.\n\nIn the hole lived Mr <em>Fox</em> and Mrs <em>Fox</em> and their four\n\nSmall <em>Foxes</em>.\n\nEvery evening", 
                      " as soon as it got dark, Mr <em>Fox</em> would say\n\nto Mrs <em>Fox</em>, \u00e2\u20ac\u02dcWell, my darling, what shall it be this time", 
                      " Mrs\n\n<em>Fox</em> had told him what she wanted, Mr <em>Fox</em> would creep\n\ndown into the valley in the darkness", 
                      " in a\n\ndark place somewhere on his own farm, hoping to catch\n\nthe robber.\n\nBut Mr <em>Fox</em> was too clever"
                  ]
              }, 
              {
                  "field": "dc:title.fulltext", 
                  "segments": [
                      "Fantastic Mr. <em>Fox</em>"
                  ]
              }
          ]
      }
      

      is much more usable

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h