Skip to content

Conversation

@pierreminik
Copy link

What does this PR do ?

Adds the suggest keyword to whitelisted ES search body.

@codecov
Copy link

codecov bot commented Mar 15, 2021

Codecov Report

Merging #2019 (ca733a3) into 2-dev (827ae8d) will not change coverage.
The diff coverage is 100.00%.

❗ Current head ca733a3 differs from pull request most recent head 255a4b5. Consider uploading reports for the commit 255a4b5 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##            2-dev    #2019   +/-   ##
=======================================
  Coverage   93.83%   93.83%           
=======================================
  Files         123      123           
  Lines        7727     7727           
=======================================
  Hits         7251     7251           
  Misses        476      476           
Impacted Files Coverage Δ
lib/api/controllers/documentController.js 97.54% <ø> (ø)
lib/service/storage/elasticsearch.js 92.37% <ø> (ø)
lib/api/funnel.js 96.24% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 827ae8d...255a4b5. Read the comment docs.

Copy link
Contributor

@Aschen Aschen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, it's very much appreciated ;-)

Can you also update the documentation to reflect this change ? https://github.com/kuzzleio/kuzzle/blob/master/doc/2/guides/main-concepts/querying/index.md

Also since the result of the suggest keyword are not including in the hits array, you will need to add it in the return of the controller action here: https://github.com/kuzzleio/kuzzle/blob/master/lib/api/controllers/documentController.js#L93

@pierreminik
Copy link
Author

I hope I've done it correctly. 😊

@Aschen
Copy link
Contributor

Aschen commented Mar 17, 2021

If you could just add/modify an unit test in the document controller, verifying that the suggest property from the Elasticsearch result is correctly returned in the document controller action it would be perfect 👍

scottinet pushed a commit to kuzzleio/sdk-javascript that referenced this pull request Mar 18, 2021
## What does this PR do?

Add support for ES suggesters (`suggest` keyword) 

See also kuzzleio/kuzzle#2019


### Other changes

  - reduce the bundle size by ignoring node packages for the web build `230KB => 137KB` (fix #616)
@pierreminik
Copy link
Author

I haven't quite catched how the mocking works so I'm not sure if it's the implementation failing or test not properly test up. I'll figure it out.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pierreminik
Copy link
Author

It seems to go through now. I'm not sure if the suggest keyword should be available when doing a scroll besides the search?

@Aschen
Copy link
Contributor

Aschen commented Mar 19, 2021

It seems to go through now. I'm not sure if the suggest keyword should be available when doing a scroll besides the search?

Since the _formatSearchResult is used by both search and scroll it's already available in scroll as well 👍

@scottinet scottinet changed the title Added “suggest” to whitelisted ES search body keys Add “suggest” to the whitelisted ES search body keys Mar 19, 2021
@scottinet scottinet merged commit d875fda into kuzzleio:2-dev Mar 19, 2021
@MathieuVeber MathieuVeber mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants