Skip to content

Instantly share code, notes, and snippets.

@awjian
Last active November 13, 2024 14:55
Show Gist options
  • Select an option

  • Save awjian/55c422bd0c0d1d8fff690d7df49c418b to your computer and use it in GitHub Desktop.

Select an option

Save awjian/55c422bd0c0d1d8fff690d7df49c418b to your computer and use it in GitHub Desktop.
beyond-the-search-bar-examples
// The Search Bar (name, description, synonyms, campaign)
https://search-playground.mongodb.com/tools/code-playground/snapshots/671a6986de97729370b8aceb
// Facets and Filtering
1. Facets (size, type): https://search-playground.mongodb.com/tools/code-playground/snapshots/671a69624b393da1cfa88572
2. Filtering (size, type): https://search-playground.mongodb.com/tools/code-playground/snapshots/671a694a4b393da1cfa88570
// Sorting (Price)
https://search-playground.mongodb.com/tools/code-playground/snapshots/671a69bfde97729370b8aced
// Pagination (1 result per page)
1. Page 1 generating searchSequenceToken: https://search-playground.mongodb.com/tools/code-playground/snapshots/671a69eade97729370b8acef
2. Page 1 -> Page 2 using searchAfter: https://search-playground.mongodb.com/tools/code-playground/snapshots/671a6a374b393da1cfa88575
3. Page 2 -> Page 4 using searchAfter + $skip: https://search-playground.mongodb.com/snapshots/662e8781f23d8023d947a4c1
4. Page 4 -> Page 3 using searchBefore: https://search-playground.mongodb.com/tools/code-playground/snapshots/671a6af44b393da1cfa88579
// Autocomplete
1. Partial match: https://search-playground.mongodb.com/snapshots/662e88e3f23d8023d947a4ca
2. Query suggestion: https://search-playground.mongodb.com/snapshots/662e73fafcdc5b85d3056945
3. Keyword auto-correction: https://search-playground.mongodb.com/snapshots/662e7485fcdc5b85d3056947
4. Filter suggestion: https://search-playground.mongodb.com/tools/code-playground/snapshots/66d71159922e94b782d591e0
@asher890824
Copy link

Sorry for bothering you. However, Filter suggestion: https://search-playground.mongodb.com/snapshots/663153e9fcdc5b85d3056bcb
it seems not working when I run the query.
image

@awjian
Copy link
Author

awjian commented Sep 3, 2024

Hi @asher890824 , thanks for flagging this! I've updated the link -- can you try now?

@gilliganc
Copy link

Are these still working? Is there something you need to do apart from clicking the run button? I tried just running the first 3 to see the results as
image
Originally i thought i could just run it and it would work and then tweak it to understand it all better

@awjian
Copy link
Author

awjian commented Oct 24, 2024

@gilliganc Updated! There should be results now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment