Skip to content

Result.getValue(options) broken in v2024.2.9 #320

@nemchik

Description

@nemchik

#319 has broken Result.getValue(options).

Examples are using

//Add additional code
...
var searchResults = mySearch.run().getRange({
    start: 0,
    end: 100
});
for (var i = 0; i < searchResults.length; i++) {
  var amount = searchResults[i].getValue({
    name: 'amount'
  });
  var entity = searchResults[i].getValue({
    name: 'name',
    join: 'location'
  });
...
//Add additional code 

Shows the following

Argument of type { name: string; } is not assignable to parameter of type string | Column.
Property 'toJSON' is missing in type { name: string; } but required in type Column. ts(2345)

And

Argument of type { name: string; join: string; } is not assignable to parameter of type string | Column.
Property toJSON is missing in type { name: string; join: string; } but required in type Column. ts(2345)

It seems like Column and options need to be separately defined so that both can be used. The intention of #319 looks to be trying to handle returning a search.Column when using search.createColumn(options) or various other places that would return a Column, but the changes remove the ability to use Result.getValue(options).

Currently v2024.2.9 is the only affected release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions