Skip to content

feat(firestore): Added public preview support for full-text search and geo search in Pipelines.#7824

Merged
MarkDuckworth merged 24 commits intomainfrom
markduckworth/search
Apr 9, 2026
Merged

feat(firestore): Added public preview support for full-text search and geo search in Pipelines.#7824
MarkDuckworth merged 24 commits intomainfrom
markduckworth/search

Conversation

@MarkDuckworth
Copy link
Copy Markdown
Contributor

@MarkDuckworth MarkDuckworth commented Mar 19, 2026

search

BEGIN_COMMIT_OVERRIDE
chore(firestore): Added public preview support for full-text search and geo search in Pipelines
END_COMMIT_OVERRIDE

@MarkDuckworth MarkDuckworth requested a review from a team as a code owner March 19, 2026 15:24
@product-auto-label product-auto-label bot added the api: cloudsearch Issues related to the Cloud Search API. label Mar 19, 2026
@MarkDuckworth MarkDuckworth changed the title search feat: Firestore Search Mar 19, 2026
Comment thread handwritten/firestore/dev/src/pipelines/expression.ts Outdated
Comment thread handwritten/firestore/dev/src/pipelines/expression.ts Outdated
Comment thread handwritten/firestore/dev/src/pipelines/expression.ts
Comment thread handwritten/firestore/dev/src/pipelines/expression.ts Outdated
Comment thread handwritten/firestore/dev/src/pipelines/expression.ts Outdated
Comment thread handwritten/firestore/dev/src/pipelines/expression.ts Outdated
@MarkDuckworth MarkDuckworth removed the api: cloudsearch Issues related to the Cloud Search API. label Mar 23, 2026
@MarkDuckworth MarkDuckworth changed the title feat: Firestore Search feat: Added public preview support for full-text search and geo search in Pipelines. Apr 2, 2026
@dlarocque dlarocque self-requested a review April 7, 2026 16:09
Comment thread handwritten/firestore/dev/src/pipelines/expression.ts
Comment thread handwritten/firestore/dev/src/pipelines/expression.ts Outdated
Comment thread handwritten/firestore/dev/src/pipelines/pipelines.ts
Comment thread handwritten/firestore/dev/src/pipelines/pipelines.ts
Comment thread handwritten/firestore/dev/src/pipelines/pipelines.ts
@MarkDuckworth MarkDuckworth requested a review from dlarocque April 8, 2026 17:32
@MarkDuckworth MarkDuckworth added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 8, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 8, 2026
@MarkDuckworth MarkDuckworth merged commit 228fe85 into main Apr 9, 2026
36 checks passed
@MarkDuckworth MarkDuckworth deleted the markduckworth/search branch April 9, 2026 15:13
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")),
    )
```
@MarkDuckworth MarkDuckworth changed the title feat: Added public preview support for full-text search and geo search in Pipelines. feat(firestore): Added public preview support for full-text search and geo search in Pipelines. Apr 10, 2026
@MarkDuckworth MarkDuckworth added the release-please:force-run To run release-please label Apr 10, 2026
@release-please release-please bot removed the release-please:force-run To run release-please label Apr 10, 2026
@MarkDuckworth MarkDuckworth added the release-please:force-run To run release-please label Apr 13, 2026
@release-please release-please bot removed the release-please:force-run To run release-please label Apr 13, 2026
@MarkDuckworth MarkDuckworth added the release-please:force-run To run release-please label Apr 13, 2026
@release-please release-please bot removed the release-please:force-run To run release-please label Apr 13, 2026
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.

3 participants