@@ -5648,7 +5648,7 @@ declare namespace FirebaseFirestore {
56485648 *
56495649 * @remarks This Expression can only be used within a `Search` stage.
56505650 *
5651- * @param rquery Define the search query using the search DTS (TODO(search) link) .
5651+ * @param rquery Define the search query using the search DSL .
56525652 */
56535653 snippet ( rquery : string ) : Expression ;
56545654
@@ -11460,30 +11460,45 @@ declare namespace FirebaseFirestore {
1146011460 * @remarks This Expression can only be used within a `Search` stage.
1146111461 *
1146211462 * @param searchField Search the specified field.
11463- * @param rquery Define the search query using the search DTS .
11463+ * @param rquery Define the search query using the search DSL .
1146411464 */
1146511465 export function matches (
1146611466 searchField : string | Field ,
1146711467 rquery : string | Expression ,
1146811468 ) : BooleanExpression ;
1146911469
1147011470 /**
11471- * Perform a full-text search on the document.
11471+ * Perform a full-text search on all indexed search fields in the document.
1147211472 *
1147311473 * @remarks This Expression can only be used within a `Search` stage.
1147411474 *
11475- * @param rquery Define the search query using the rquery DTS.
11475+ * @example
11476+ * ```typescript
11477+ * db.pipeline().collection('restaurants').search({
11478+ * query: documentMatches('waffles OR pancakes')
11479+ * })
11480+ * ```
11481+ *
11482+ * @param rquery Define the search query using the search DSL.
1147611483 */
1147711484 export function documentMatches (
1147811485 rquery : string | Expression ,
1147911486 ) : BooleanExpression ;
1148011487
1148111488 /**
1148211489 * Evaluates to the search score that reflects the topicality of the document
11483- * to all of the text predicates (`queryMatch `)
11490+ * to all of the text predicates (for example: `documentMatches `)
1148411491 * in the search query. If `SearchOptions.query` is not set or does not contain
1148511492 * any text predicates, then this topicality score will always be `0`.
1148611493 *
11494+ * @example
11495+ * ```typescript
11496+ * db.pipeline().collection('restaurants').search({
11497+ * query: 'waffles',
11498+ * sort: score().descending()
11499+ * })
11500+ * ```
11501+ *
1148711502 * @remarks This Expression can only be used within a `Search` stage.
1148811503 */
1148911504 export function score ( ) : Expression ;
@@ -11492,10 +11507,18 @@ declare namespace FirebaseFirestore {
1149211507 * Evaluates to an HTML-formatted text snippet that highlights terms matching
1149311508 * the search query in `<b>bold</b>`.
1149411509 *
11510+ * @example
11511+ * ```typescript
11512+ * db.pipeline().collection('restaurants').search({
11513+ * query: 'waffles',
11514+ * addFields: { snippet: snippet('menu', 'waffles') }
11515+ * })
11516+ * ```
11517+ *
1149511518 * @remarks This Expression can only be used within a `Search` stage.
1149611519 *
1149711520 * @param searchField Search the specified field for matching terms.
11498- * @param rquery Define the search query using the search DTS (TODO(search) link) .
11521+ * @param rquery Define the search query using the search DSL .
1149911522 */
1150011523 export function snippet (
1150111524 searchField : string | Field ,
@@ -11509,7 +11532,7 @@ declare namespace FirebaseFirestore {
1150911532 * @remarks This Expression can only be used within a `Search` stage.
1151011533 *
1151111534 * @param searchField Search the specified field for matching terms.
11512- * @param options Define the search query using the search DTS (TODO(search) link) .
11535+ * @param options Define the search query using the search DSL .
1151311536 */
1151411537 export function snippet (
1151511538 searchField : string | Field ,
@@ -11520,6 +11543,14 @@ declare namespace FirebaseFirestore {
1152011543 * Evaluates to the distance in meters between the location in the specified
1152111544 * field and the query location.
1152211545 *
11546+ * @example
11547+ * ```typescript
11548+ * db.pipeline().collection('restaurants').search({
11549+ * query: 'waffles',
11550+ * sort: geoDistance('location', new GeoPoint(37.0, -122.0)).ascending()
11551+ * })
11552+ * ```
11553+ *
1152311554 * @remarks This Expression can only be used within a `Search` stage.
1152411555 *
1152511556 * @param fieldName - Specifies the field in the document which contains
@@ -13118,11 +13149,11 @@ declare namespace FirebaseFirestore {
1311813149 * are supported in the Search query.
1311913150 *
1312013151 * @example
13121- * ```
13152+ * ```typescript
1312213153 * db.pipeline().collection('restaurants').search({
1312313154 * query: or(
13124- * documentContainsText ("breakfast"),
13125- * field ('menu').containsText( 'waffle AND coffee')
13155+ * documentMatches ("breakfast"),
13156+ * matches ('menu', 'waffle AND coffee')
1312613157 * )
1312713158 * })
1312813159 * ```
@@ -13146,8 +13177,8 @@ declare namespace FirebaseFirestore {
1314613177 // TODO(search) add indexPartition after languageCode
1314713178
1314813179 /**
13149- * The maximum number of documents for the search stage to score. Documents
13150- * will be processed in the pre-sort order specified by the search index.
13180+ * The maximum number of documents to retrieve. Documents will be retrieved in the
13181+ * pre-sort order specified by the search index.
1315113182 */
1315213183 retrievalDepth ?: number ;
1315313184
@@ -13190,7 +13221,7 @@ declare namespace FirebaseFirestore {
1319013221 */
1319113222 export type SnippetOptions = {
1319213223 /**
13193- * Define the search query using the search DTS .
13224+ * Define the search query using the search DSL .
1319413225 */
1319513226 rquery : string ;
1319613227
0 commit comments