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

Do not render index card twice #1243

Merged
merged 1 commit into from
May 10, 2024

Conversation

burieberry
Copy link
Contributor

@burieberry burieberry commented May 10, 2024

1- The change in this PR should prevent the index card from rendering unnecessarily in the background

2- Looked into why the search query seems to be running multiple times as mentioned in ticket CS-6802. It is because we are running the query for each realm to display results from all available realms. This is why the result returned for each query is different.

await Promise.all(
this.realmsToSearch.map(
async (realm) => await this.cardService.search(query, new URL(realm)),
),

async search(query: Query, realmURL: URL): Promise<CardDef[]> {
let json = await this.fetchJSON(`${realmURL}_search?${stringify(query)}`);

Is there a better way to do this now that we have postgres?

@burieberry burieberry requested review from a team, tintinthong and habdelra May 10, 2024 16:20
Copy link

Host Tests (DB Index) Test Results

608 tests  ±0   605 ✔️ ±0   11m 8s ⏱️ -2s
    1 suites ±0       3 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit eb8b54c. ± Comparison against base commit 04a2db4.

Copy link

Host Tests (In-Memory Index) Test Results

608 tests  ±0   603 ✔️ ±0   11m 9s ⏱️ +50s
    1 suites ±0       5 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit eb8b54c. ± Comparison against base commit 04a2db4.

@habdelra
Copy link
Contributor

2- Looked into why the search query seems to be running multiple times as mentioned in ticket CS-6802. It is because we are running the query for each realm to display results from all available realms. This is why the result returned for each query is different.

ah, makes sense--thanks for checking into that!

@habdelra
Copy link
Contributor

await Promise.all(
this.realmsToSearch.map(
async (realm) => await this.cardService.search(query, new URL(realm)),
),

async search(query: Query, realmURL: URL): Promise<CardDef[]> {
let json = await this.fetchJSON(`${realmURL}_search?${stringify(query)}`);

Is there a better way to do this now that we have postgres?

the postgres integration did not change any API's. we still issue our queries exactly the same as before the change--it's just that internally we query a DB instead of matching against docs in a giant map.

@burieberry burieberry merged commit ff6fc92 into main May 10, 2024
28 checks passed
@delete-merged-branch delete-merged-branch bot deleted the cs-6802-index-card-search-query-duplicated branch May 10, 2024 19:04
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.

2 participants