You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4368b5e
Browse filesBrowse the repository at this point in the historyBrowse files
/// More information about MongoDB distance functions here: <see href="https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/#atlas-vector-search-index-fields" />.
/// <summary>Builds the full text search query stage.</summary>
266
+
privatestaticBsonDocumentGetFullTextSearchQuery(
267
+
ICollection<string>keywords,
268
+
stringfullTextSearchIndexName,
269
+
stringtextPropertyName,
270
+
BsonDocument?filter)
271
+
{
272
+
varfullTextSearchQuery=newBsonDocument
273
+
{
274
+
{
275
+
"$search",newBsonDocument
276
+
{
277
+
{"index",fullTextSearchIndexName},
278
+
{"text",
279
+
newBsonDocument
280
+
{
281
+
{"query",newBsonArray(keywords)},
282
+
{"path",textPropertyName},
283
+
{"matchCriteria","any"}
284
+
}
285
+
}
286
+
}
287
+
}
288
+
};
289
+
290
+
returnfullTextSearchQuery;
291
+
}
292
+
293
+
/// <summary>Create a stage that groups all documents into a single document with an array property containing all the source documents.</summary>
294
+
privatestaticBsonDocumentGroupDocsSection()
295
+
{
296
+
returnnewBsonDocument
297
+
{
298
+
{
299
+
"$group",newBsonDocument
300
+
{
301
+
{"_id",BsonNull.Value},
302
+
{"docs",newBsonDocument{{"$push","$$ROOT"}}}
303
+
}
304
+
}
305
+
};
306
+
}
307
+
308
+
/// <summary>Creates a stage that splits an array of documents from a single document into separate documents and adds an index property for each document based on its index in the array.</summary>
309
+
privatestaticBsonDocumentUnwindDocsArraySection()
310
+
{
311
+
returnnewBsonDocument
312
+
{
313
+
{
314
+
"$unwind",newBsonDocument
315
+
{
316
+
{"path","$docs"},
317
+
{"includeArrayIndex","rank"}
318
+
}
319
+
}
320
+
};
321
+
}
322
+
323
+
/// <summary>Adds a weighted score to each document based on the rank property on the document.</summary>
0 commit comments