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

Allow search and multi-search to return raw data #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevinwang-oversoul
Copy link

@kevinwang-oversoul kevinwang-oversoul commented May 6, 2024

Change Summary

Overriden 2 function:

  • Documents.search()
  • MultiSearch.perform()

Why make this change

Currently the above 2 function will take a Codable type T and then try to decode it immediately after retrieving the data. This is not ideal because we lose the opportunities to implement a custom data parsing logic to it. E.g.

  • Documents.search(): This function uses the default JSON decoder to decode the data. But sometimes we want to use other decoders, such as Firestore Decoder.
  • MultiSearch.perform(): This function only takes 1 type of Codable, which is not ideal. E.g. for a social media app, when searching a post, we want to have some search suggestions. They are different types of data and the function won't be able to decode the multi search result.

PR Checklist

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.

None yet

1 participant