Skip to content

[bug]: Score field is missing in the Recommendation API response #3940

@scpatricklim

Description

@scpatricklim

Description

According to the documentation https://www.algolia.com/doc/rest-api/recommend/#tag/recommendations/operation/getRecommendations the recommendation API response returns both the _score field and objectID as mandatory fields however we encounter the _score field being empty which breaks our validation.

This can be reproduce by calling getRecommendations on a newly added record prior retraining the model.

Can you advise is this an expected behaviour and the _score field is expected to be optional ?

Language

All

Client

All

Steps to reproduce

  1. Add a new record to the index via the SaveObject method
client, err := search.NewClient(appID, apiKey)
if err != nil {
    panic(err)
}
// Add record to an index
saveResp, err := client.SaveObject(
    client.NewSaveObjectRequest(indexName, record),
)
  1. call the recommendation API on the same record.
  2. inspect the response which doesn't contains the _score field

Relevant log output

No response

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions