Skip to content

Phrase suggest options score value alway null.  #2681

Closed
@sebastien-comeau

Description

@sebastien-comeau

Phrase suggest options from my Elasticsearch response contains option score values, The PhraseSuggestion.Entry.Option's score field value is alway null. Null is being assigned to score and collateMatch in SearchDocumentResponseBuilder.getPhraseSuggestion.

.add(new PhraseSuggestion.Entry.Option(optionES.text(), optionES.highlighted(), null, null)));

Elasticsearch response

{
  "took": 16,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 0,
      "relation": "eq"
    },
    "max_score": null,
    "hits": []
  },
  "suggest": {
    "suggestionEn": [
      {
        "text": "National",
        "offset": 0,
        "length": 8,
        "options": [
          {
            "text": "nations",
            "score": 0.11480146
          },
          {
            "text": "national",
            "score": 0.08063514
          }
        ]
      }
    ],
    "suggestionFr": [
      {
        "text": "National",
        "offset": 0,
        "length": 8,
        "options": [
          {
            "text": "nations",
            "score": 0.0943285
          },
          {
            "text": "national",
            "score": 0.08952732
          }
        ]
      }
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions