Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-14763

SOLR Rest API results have null title field

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.8
    • Fix Version/s: 9.9-rc-2
    • Component/s: Search - Solr
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Pull Request Status:
      Pull Request accepted
    • Similar issues:

      Description

      The title field in search results using the SOLR endpoint seems to always be null. For example, making a request to

      /xwiki/rest/wikis/xwiki/query?type=solr&start=0&number=5&prettyNames=true&distinct=true&q=test&media=json
      

      returns a result like:

          {
            "links": [
              {
                "href": "...omitted...",
                "rel": "http://www.xwiki.org/rel/page",
                "type": null,
                "hrefLang": null
              }
            ],
            "type": "page",
            "id": "xwiki:Main.WebHome",
            "pageFullName": "Main.WebHome",
            "title": null,
            "wiki": "xwiki",
            "space": "Main",
            "pageName": "WebHome",
            "modified": 1501282765000,
            "author": "xwiki:XWiki.msullivan",
            "authorName": "Matt Sullivan",
            "version": "5.1",
            "language": null,
            "className": null,
            "objectNumber": null,
            "filename": null,
            "score": 59.332226,
            "object": null
          }
      

      Looking at the code a bit, it looks like it's trying to populate the title from the "title" field in the solr document. However this field seems to be a multi-lingual field, so it should probably look in the appropriate localized field, e.g. "title_en". I have a PR incoming to fix this.

        Attachments

          Activity

            People

            • Assignee:
              clicky Matt Sullivan
              Reporter:
              clicky Matt Sullivan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: