Skip to content

boost in SearchRequest interface misspelled - getting error on Prod #65

Open
@Ricardo385

Description

@Ricardo385

🐛 Bug Report

When trying to use the "boost" params from the .search() method I got an error in my request, however, searching in the Elastic Docs I realized that is "boosts" (in plural). The definition type needs to be changed here, specifically in node_modules/@elastic/enterprise-search/lib/api/app/types.d.ts line 2028.

To Reproduce

Steps to reproduce the behavior:

Paste your code here:

await elasticSearchClient.search({
            engine_name: engine-name,
            body: {
                query: body.query,
                boost: { // here instead is boosts
                    my-variable-name: [
                        {
                            type: 'value',
                            value: body.query,
                            operation: 'multiply',
                            factor: 10,
                        },
                    ],
            },
        });

Expected behavior

A clear and concise description of what you expected to happen.

Paste the results here:

await elasticSearchClient.search({
            engine_name: engine-name,
            body: {
                query: body.query,
                boosts: {
                    my-variable-name: [
                        {
                            type: 'value',
                            value: body.query,
                            operation: 'multiply',
                            factor: 10,
                        },
                    ],
            },
        });

Your Environment

  • node version: 18
  • @elastic/enterprise-search version: 8.6.1
  • os: Mac
  • any other relevant information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions