-
Notifications
You must be signed in to change notification settings - Fork 37
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
Feature: Update results to display non-source fields in search comparison tool #340
Conversation
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #340 +/- ##
==========================================
+ Coverage 87.08% 87.14% +0.06%
==========================================
Files 16 16
Lines 209 210 +1
Branches 43 43
==========================================
+ Hits 182 183 +1
Misses 26 26
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, nice work on the implementation. I left some comments that nitpick a little bit on specifics, may need to engage @kgcreative on some of the UX. Should we indicate a difference between non-source fields and source fields in the comparison tool?
@@ -44,17 +44,19 @@ export const ResultGridComponent = ({ | |||
); | |||
}; | |||
|
|||
const getDlTmpl = (doc: IDocType) => { | |||
const getDlTmpl = (doc: Document) => { | |||
const sourceFields = Object.assign(doc._source, doc.fields); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the event that we have the same field in the source
and the fields
, which one should take precedence? Or should we find a way to display both and indicate which fields are from mappings/fields and which fields are from the source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the description in #201, I implemented this so the field from the fields
would take precedence. I can change this so that both are displayed though.
public/components/query_compare/search_result/result_components/result_grid.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
…#340) * Update results to display fields property in addition to source Signed-off-by: Nicholas Ung <nicholasung22@gmail.com> * Return result bins to limited height Signed-off-by: Nicholas Ung <nicholasung22@gmail.com> * Add back space between entries Signed-off-by: Nicholas Ung <nicholasung22@gmail.com> --------- Signed-off-by: Nicholas Ung <nicholasung22@gmail.com> (cherry picked from commit 8f1422d) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…#340) (#354) * Update results to display fields property in addition to source * Return result bins to limited height * Add back space between entries --------- (cherry picked from commit 8f1422d) Signed-off-by: Nicholas Ung <nicholasung22@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Hey @hdhalter, this feature has already been backported to the |
Description
Adds the ability to view non-source fields in the results grid when using the search comparison tool. The result object
sourceFields
is first populated with fields from_source
(if available), then is overlayed with field values from thefields
property. If a field is available in both_source
andfields
, the value infields
overwrites the value in_source
.Ran this script in the Search Comparison tool to populate sample data result documents with a
fields
property:Issues Resolved
Closes #201
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Screenshots
Note: Bins in result were grid were expanded specifically for the screenshots to observe changes. No modifications were made to current bin height.
Before:
fields
property is not displayedAfter: unique field
FlightNumNew
is visible at the bottom of the result grid, while the original value of the_source
fieldFlightNum
has been overwritten with the value fromfields