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

Anchor index and queries #205

Open
ComLock opened this issue Sep 19, 2022 · 1 comment
Open

Anchor index and queries #205

ComLock opened this issue Sep 19, 2022 · 1 comment

Comments

@ComLock
Copy link
Member

ComLock commented Sep 19, 2022

So there is a "main query", over a "main index".

This "main index" contains "all" the text of an url.

Then there is a "chapter index", which only contains the text of the chapter.

mainQuery() {
  hits {
    _id
    title
    url
    highlight
    ... on somePageThatHasChapters {
      searchChapterIndex(wherePageId: _id) {
        chapterId
        chapterTitle
        chapterUrl
        chapterHighlight
      } # searchChapterIndex
    } # on
  } # hits
} # mainQuery
@ComLock ComLock self-assigned this Sep 19, 2022
@ComLock
Copy link
Member Author

ComLock commented Sep 19, 2022

Let's say you present 10 results per search page.
If all those 10 have chapters, then, 10 additional queries would have to run (serverside, synchronousy) before returning the result.

That might be too slow.

Since our client is dynamic (react), we could execute those 10 queries as independent asyncronous searches, rather than 10 syncronous sub-searches.

@ComLock ComLock changed the title Nested queries Anchor index and queries Sep 19, 2022
@ComLock ComLock removed their assignment Mar 12, 2024
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

No branches or pull requests

1 participant