Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added IRefiner interface over ResultTable.Refiners. #352

Merged
merged 1 commit into from
Nov 14, 2018
Merged

Added IRefiner interface over ResultTable.Refiners. #352

merged 1 commit into from
Nov 14, 2018

Conversation

pljfdi
Copy link
Contributor

@pljfdi pljfdi commented Nov 8, 2018

Should make them easier to return to results

Category

  • Bug fix?
  • New feature?
  • New sample?
  • Documentation update?

Related Issues

You cannot easily return the Refiners from the SearchResults, without having to an entire ResultsTable. Which is a little wasteful.
This is a simple interface, that allows you to return only the refiners array explicitly.

What's in this Pull Request?

sp/Search.ts added interface IRefiner and altered the ResultTable interface changing ResultTable.Refiners to be IRefiner

Should make them easier to return to results
@patrick-rodgers patrick-rodgers added this to the 1.2.6 milestone Nov 14, 2018
@patrick-rodgers
Copy link
Member

Thanks, this should be a help to folks!

@patrick-rodgers patrick-rodgers merged commit 12ec2e5 into pnp:dev Nov 14, 2018
@bcage29
Copy link

bcage29 commented Nov 25, 2018

@pljfdi @patrick-rodgers this change causes a bug. The new interface is missing brackets at the end to indicate it is an array.

{ RefinementCount: string; RefinementName: string; RefinementToken: string; RefinementValue: string; }[];

@pljfdi
Copy link
Contributor Author

pljfdi commented Nov 26, 2018

The new interface isn't an array type object, and isn't meant to be. It's just the layout of what a refiner is. All the IRefiner does is alias a bunch of fields behind a name, so that you can more easily get the Refiner results from a Search Result Table.
The implementation in ResultTable is an array, as it's that object that returns multiple Refiners.

Have you got a code example where it would cause a break, or a bug?

@patrick-rodgers
Copy link
Member

If there is a bug please open an issue so we can properly track it and ensure it is resolved. Thanks!

@cslecours
Copy link
Contributor

I have opened a bug and made a pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants