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

SOLR Rest API results have null title field

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 9.9-rc-2
    • 9.8
    • Search - Solr
    • None
    • Unknown
    • N/A
    • N/A
    • Pull Request accepted

    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

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

            Dates

              Created:
              Updated:
              Resolved: