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

feat: add groq2024 search strategy #7838

Merged
merged 5 commits into from
Dec 10, 2024
Merged

Conversation

juice49
Copy link
Contributor

@juice49 juice49 commented Nov 18, 2024

Description

This branch introduces a new search strategy: groq2024. This strategy adopts GROQ's new text::query function and ability to match all text content inside an object using @ match text::query($query). This enables dataset search without necessitating every searchable path in the schema is serialised and included in the search request (as is the case with groqLegacy search).

This experimental strategy is being added to Studio behind a flag so that interested users can help us test it, before it hopefully graduates to being the default search strategy.

To enable this strategy, set search.strategy to "groq2024" inside the Studio config.

import {defineConfig} from 'sanity`

export default defineConfig({
+ search: {
+   strategy: 'groq2024',
+ },
})

What to review

  • Test Studio has been updated to use groq2024. You can try it out using any search surface (global search, document lists, and reference search).
  • Are there any obvious issues or design flaws in the implementation of the new strategy?
  • Are there any big issues that should be addressed before the experimental release of groq2024?

Testing

  • Added unit tests for new functionality.

Copy link

vercel bot commented Nov 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 10:07am
performance-studio ✅ Ready (Inspect) Visit Preview Dec 10, 2024 10:07am
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 10:07am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 10:07am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 10:07am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Dec 10, 2024 10:07am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Nov 18, 2024

Component Testing Report Updated Dec 10, 2024 10:01 AM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 16s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 41s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 1m 0s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 17s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 2m 10s 2 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 18s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 2m 59s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 56s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 15s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 44s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 1s 12 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

Copy link
Contributor

github-actions bot commented Nov 18, 2024

⚡️ Editor Performance Report

Updated Tue, 10 Dec 2024 10:03:18 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 26.3 efps (38ms) 24.4 efps (41ms) +3ms (+7.9%)
article (body) 67.6 efps (15ms) 72.2 efps (14ms) -1ms (-/-%)
article (string inside object) 25.6 efps (39ms) 25.0 efps (40ms) +1ms (+2.6%)
article (string inside array) 23.0 efps (44ms) 21.7 efps (46ms) +3ms (+5.7%)
recipe (name) 55.6 efps (18ms) 52.6 efps (19ms) +1ms (+5.6%)
recipe (description) 62.5 efps (16ms) 58.8 efps (17ms) +1ms (+6.3%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 19.8 efps (51ms) 18.3 efps (55ms) +4ms (+7.9%)
synthetic (string inside object) 18.5 efps (54ms) 18.2 efps (55ms) +1ms (+1.9%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 38ms 40ms 44ms 223ms 259ms 10.5s
article (body) 15ms 17ms 21ms 90ms 227ms 5.0s
article (string inside object) 39ms 41ms 43ms 187ms 136ms 7.0s
article (string inside array) 44ms 46ms 50ms 160ms 149ms 7.0s
recipe (name) 18ms 20ms 23ms 38ms 0ms 7.3s
recipe (description) 16ms 17ms 19ms 26ms 0ms 4.4s
recipe (instructions) 5ms 6ms 7ms 7ms 0ms 3.0s
synthetic (title) 51ms 53ms 58ms 91ms 494ms 12.7s
synthetic (string inside object) 54ms 58ms 72ms 313ms 636ms 8.2s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 41ms 44ms 50ms 167ms 169ms 10.5s
article (body) 14ms 17ms 21ms 144ms 202ms 5.0s
article (string inside object) 40ms 43ms 50ms 275ms 271ms 7.0s
article (string inside array) 46ms 48ms 56ms 145ms 140ms 7.3s
recipe (name) 19ms 22ms 28ms 40ms 0ms 7.0s
recipe (description) 17ms 18ms 20ms 32ms 0ms 4.5s
recipe (instructions) 5ms 6ms 7ms 7ms 0ms 3.0s
synthetic (title) 55ms 56ms 62ms 85ms 299ms 14.9s
synthetic (string inside object) 55ms 58ms 70ms 116ms 478ms 7.8s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

It's only necessary to deduplicate search results when using the
Text Search API, because this API sometimes produces duplicate results
at page boundaries.
Search results now only fade out when input parameters change,
reflecting that the results that have already been loaded no longer
match the input parameters.

They no longer fade out when fetching more results for the same set of
input parameters.
Copy link
Contributor

@pedrobonamin pedrobonamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @juice49 !
Tests are really helpful to understand the changes.

It looks good to me!

@juice49
Copy link
Contributor Author

juice49 commented Dec 10, 2024

Thanks, @pedrobonamin 🙏.

@juice49 juice49 removed the request for review from ricokahler December 10, 2024 10:21
@juice49 juice49 merged commit 8c4e248 into next Dec 10, 2024
58 checks passed
@juice49 juice49 deleted the feat/sapp-30/new-groq-search branch December 10, 2024 10:23
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