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

SearchPage: use sparse fields to improve query performance #1066

Merged
merged 4 commits into from
Apr 12, 2019

Conversation

Gnito
Copy link
Contributor

@Gnito Gnito commented Apr 12, 2019

NOTE: If you have changed ListingCard component, check if any data is missing on SearchPage. This deliberately drops some of the fields of Listing entity away from template.

This improves SearchPage performance a bit by reducing the amount of fetched data. It also serves as an example of how to use sparse fields:

    'fields.listing': ['title', 'geolocation', 'price'],
    'fields.user': ['profile.displayName', 'profile.abbreviatedName'],

This change also improved ListingPage a bit, since we were making assumptions of certain data to be unnecessarily required.

There are 2 renamed files in src/containers/ListingPage/:
SectionFeatures.js -> SectionFeaturesMaybe.js
SectionHost.js -> SectionHostMaybe.js

@Gnito Gnito force-pushed the search-page-uses-sparse-fields branch from 508ae1e to 812ec46 Compare April 12, 2019 12:07
@Gnito Gnito changed the title Search page uses sparse fields SearchPage: use sparse fields to improve query performance Apr 12, 2019
@Gnito Gnito merged commit d31055f into master Apr 12, 2019
@Gnito Gnito mentioned this pull request Apr 24, 2019
@Gnito Gnito deleted the search-page-uses-sparse-fields branch May 8, 2019 10:40
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.

1 participant