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

Return explDict in consistent format #74

Merged
merged 1 commit into from
Jan 9, 2020
Merged

Conversation

worleydl
Copy link
Contributor

@worleydl worleydl commented Jan 9, 2020

When parsing explains from a call to _search, explDict is set to the explanation JSON object (see: https://github.com/o19s/splainer-search/blob/master/factories/esSearcherFactory.js#L218). For the "other" approach, a new object is created with the explanation nested as another property. (see: https://github.com/o19s/splainer-search/blob/master/factories/esSearcherFactory.js#L315)

As far as I can tell nothing is making using of the object structure returned by explainOther and no tests are broken. If we're worried about breaking things we can modify https://github.com/o19s/splainer-search/blob/master/factories/esDocFactory.js#L55 to check for the different structure and return the nested explain if necessary. Ultimately we probably want all methods of explain setting explDict to a consistent format.

This change fixes o19s/quepid#25

@worleydl worleydl changed the title Return explDict in same format as _search with explain does Return explDict in consistent format Jan 9, 2020
@worleydl worleydl force-pushed the bug/consistent-explDict branch from 564c4bb to 3a610f4 Compare January 9, 2020 04:26
@epugh
Copy link
Member

epugh commented Jan 9, 2020

Does fixing this also fix o19s/splainer#31 ?

If there is a refactoring that you think we should go ahead and get done (beyond what youve done), I'd love to see that happen!

@worleydl
Copy link
Contributor Author

worleydl commented Jan 9, 2020

"Find Others" isn't running for solr or elastic on the live site. It is working for Solr under a local build though.

I think the functionality can work with this change as Quepid is already doing it, we just need to iron out the kinks in Splainer (maybe another issue?)

@epugh
Copy link
Member

epugh commented Jan 9, 2020 via email

@epugh
Copy link
Member

epugh commented Jan 9, 2020

@worleydl I was going to merge and then it struck me, do we need to DRY up this code? why is the exact same query structure show up in two places.

@epugh
Copy link
Member

epugh commented Jan 9, 2020

We check in our compiled artifact (splainer-search.js) to GitHub? WAAT?

@epugh epugh merged commit f78c4d2 into master Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explain Other on ES 6 and 7 Broken
2 participants