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

[App Search] Relevance Tuning logic listeners #89461

Merged
merged 42 commits into from
Feb 10, 2021

Conversation

JasonStoltz
Copy link
Member

@JasonStoltz JasonStoltz commented Jan 27, 2021

Summary

This is Part 3 of Relevance Tuning.

I don't know if it will really be helpful to review this PR commit by commit or not, I was not diligent with these commits, and later commits definitely thrash prior ones. So it's up to you.

To move fast and reduce friction in the migration, this code is almost an exact replica of what was in ent-search. I have not changed the logic in any significant way other than to match the current patterns of our code. Please consider reviewing this as just that, a migration. There is much opportunity for refactor, but I don't think we need to take that on right now.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@JasonStoltz JasonStoltz added Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.12.0 labels Jan 27, 2021
@JasonStoltz JasonStoltz reopened this Jan 27, 2021
@JasonStoltz JasonStoltz marked this pull request as ready for review January 28, 2021 14:21
@JasonStoltz JasonStoltz requested review from a team January 28, 2021 14:21
@byronhulcher byronhulcher self-requested a review January 29, 2021 15:25
...searchFields,
[name]: {
...searchFields[name],
weight: parseFloat(weight.toFixed(1)),
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I think our discussion about whether we allow numbers vs strings of numbers has me confused. Shouldn't we do parseFloat first and then toFixed in case a '2' is being passed?

Suggested change
weight: parseFloat(weight.toFixed(1)),
weight: parseFloat(weight).toFixed(1),

Copy link
Member Author

Choose a reason for hiding this comment

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

I ended up reverting this change. toFixed returns a string which is why I have to call parseFloat. The string representation may actually not be parseable back to a float in certain cases. I think the previous implementation with Math.round is the appropriate solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

Weight is actually a number, just for reference, it can never be a string.

Copy link
Member

@cee-chen cee-chen Feb 10, 2021

Choose a reason for hiding this comment

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

Ohh gotcha gotcha, super interesting! If we're doing this in multiple places it might be nice to pull it out to a util so we can clearly explain in a single comment why we're doing it this way & so we don't forget and used toFixed later on in a different place

@cee-chen
Copy link
Member

Just a comment clarifying .toFixed (based on my testing I really think we need the parseFloat before toFixed) and a test name suggestion left and I'm good w/ this

…h/components/relevance_tuning/utils.test.ts

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Copy link
Member

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

Just realized I forgot to actually hit approve 🤦‍♀️ Thanks for all the changes & feedback rounds Jason!

@JasonStoltz
Copy link
Member Author

Great, thanks for the awesome review. I really do appreciate 👍

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1191 1192 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 1.8MB 1.9MB +10.0KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@JasonStoltz JasonStoltz merged commit a9e6cff into elastic:master Feb 10, 2021
@JasonStoltz JasonStoltz deleted the relevance-tuning-3 branch February 10, 2021 20:36
JasonStoltz added a commit to JasonStoltz/kibana that referenced this pull request Feb 10, 2021
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 11, 2021
* master: (44 commits)
  [APM] Add experimental support for Data Streams (elastic#89650)
  [Search Session] Control "Kibana / Search Sessions" management section by privileges (elastic#90818)
  [Lens] Median as default function (elastic#90952)
  Implement custom global header banner (elastic#87438)
  [Fleet] Reduce permissions. (elastic#90302)
  Update dependency @elastic/charts to v24.5.1 (elastic#89822)
  [Create index pattern] Can't create single character index without wildcard (elastic#90919)
  [ts/build_ts_refs] add support for --clean flag (elastic#91060)
  Don't clean when running e2e tests (elastic#91057)
  Fixes track_total_hits in the body not having an effect when using search strategy (elastic#91068)
  [Security Solution][Detections] Adds list plugin Saved Objects to Security feature privilege (elastic#90895)
  Removing the code plugin entirely for 8.0 (elastic#77940)
  chore(NA): move the instruction to remove yarn global bazelisk package into the first place on install bazel tools (elastic#91026)
  [jest/ci] remove max-old-space-size override to use 4gb default (elastic#91020)
  [Fleet] Restrict integration changes for managed policies (elastic#90675)
  [CI] Fix auto-backport condditions so that it doesn't trigger for other labels (elastic#91042)
  [DOCS] Uses variable to refer to query profiler (elastic#90976)
  [App Search] Relevance Tuning logic listeners (elastic#89461)
  [Metrics UI] Fix saving/loading saved views from URL (elastic#90216)
  Limit cardinality of transaction.name (elastic#90955)
  ...
JasonStoltz added a commit to JasonStoltz/kibana that referenced this pull request Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants