feat(firestore): Added public preview support for full-text search and geo search in Pipelines.#7824
Merged
MarkDuckworth merged 24 commits intomainfrom Apr 9, 2026
Merged
feat(firestore): Added public preview support for full-text search and geo search in Pipelines.#7824MarkDuckworth merged 24 commits intomainfrom
MarkDuckworth merged 24 commits intomainfrom
Conversation
dlarocque
reviewed
Mar 19, 2026
Co-authored-by: Daniel La Rocque <dlarocque@google.com>
Co-authored-by: Daniel La Rocque <dlarocque@google.com>
…loud-node into markduckworth/search
…arkduckworth/search
…loud-node into markduckworth/search
…loud-node into markduckworth/search
dlarocque
reviewed
Apr 7, 2026
…loud-node into markduckworth/search
…arkduckworth/search
dlarocque
approved these changes
Apr 8, 2026
…arkduckworth/search
bhshkh
added a commit
to googleapis/google-cloud-go
that referenced
this pull request
Apr 9, 2026
…ons (#14383) **Summary** This PR implements the `search` pipeline stage and its associated expressions in the Go Firestore SDK, providing parity with the Java (googleapis/java-firestore#2346) and Node.js (googleapis/google-cloud-node#7824) SDKs for full-text and geospatial search capabilities within Firestore Pipelines. **Key Changes** * **Search Pipeline Stage**: * Implemented the `Search` stage in `Pipeline` with a functional options pattern. * Introduced `WithSearchQuery`, `WithSearchSort`, `WithSearchAddFields`, and `WithSearchRetrievalDepth` options. * Ensured protobuf encoding places the `query` within the `Options` map (not `Args`) to align with backend requirements and the Java SDK implementation. * **Search Expressions**: * Implemented `DocumentMatches(query string)` and `Matches(field, query string)` for full-text search. * Implemented `GeoDistance(field, location)` for geospatial distance calculations. * Implemented `Score()` to retrieve the search topicality score. * Implemented `Snippet(field, query)` for highlighted search result snippets. * **Fluent API**: * Added `GeoDistance(location)`, `Matches(query)`, and `Snippet(query)` methods to the `Expression` interface to support fluent chaining (e.g., `FieldOf("location").GeoDistance(loc)`). * **Testing**: * Added comprehensive unit tests in `pipeline_test.go` and `pipeline_function_test.go`. * Verified backend request structure consistency via JSON dump comparisons. **Usage Example** ```go pipeline := client.Pipeline(). Collection("restaurants"). Search( WithSearchQuery(DocumentMatches("waffles OR pancakes")), WithSearchSort(Descending(Score())), WithSearchAddFields(Snippet("menu", "waffles").As("highlight")), ) ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
search
BEGIN_COMMIT_OVERRIDE
chore(firestore): Added public preview support for full-text search and geo search in Pipelines
END_COMMIT_OVERRIDE