Skip to content

feat: Add beta support for full-text search and geo search.#2346

Open
MarkDuckworth wants to merge 2 commits intomainfrom
markduckworth/search
Open

feat: Add beta support for full-text search and geo search.#2346
MarkDuckworth wants to merge 2 commits intomainfrom
markduckworth/search

Conversation

@MarkDuckworth
Copy link
Contributor

search

@MarkDuckworth MarkDuckworth requested a review from a team as a code owner March 23, 2026 23:08
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: firestore Issues related to the googleapis/java-firestore API. labels Mar 23, 2026
@@ -0,0 +1,173 @@
/*
* Copyright 2025 Google LLC
Copy link
Contributor Author

Choose a reason for hiding this comment

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

date

this(new FunctionExpression(name, java.util.Arrays.asList(params)));
}

BooleanFunctionExpression(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

make internal or add tests

this(name, params, java.util.Collections.emptyMap());
}

FunctionExpression(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

make internal or add tests

@Before
public void setupRestaurantDocs() throws Exception {
restaurantsCollection =
firestore.collection("SearchIntegrationTests-" + LocalFirestoreHelper.autoId());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't use autoID for search tests. These must use a collection with an index configured before the test run

.pipeline()
.collection(restaurantsCollection.getId())
.search(
Search.withQuery(documentMatches("menu:waffles"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should use query field("menu").matches(waffles).

.pipeline()
.collection(restaurantsCollection.getId())
.search(
Search.withQuery(documentMatches("menu:-waffles"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same. field(x).matches(q) OR, just negate waffle in the document search

.pipeline()
.collection(restaurantsCollection.getId())
.search(
Search.withQuery(documentMatches("menu:tacos"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

"menu:query" will not be supported at launch, so just use documentMatches.

.pipeline()
.collection(restaurantsCollection.getId())
.search(
Search.withQuery(documentMatches("menu:tacos"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same

.pipeline()
.collection(restaurantsCollection.getId())
.search(
Search.withQuery(documentMatches("menu:tacos OR chicken"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same

.pipeline()
.collection(restaurantsCollection.getId())
.search(
Search.withQuery(documentMatches("menu:chicken OR tacos OR fish OR waffles"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same

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

Labels

api: firestore Issues related to the googleapis/java-firestore API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant