Questions tagged [mongodb-atlas-search]

MongoDB Atlas Search is a cloud product based on Apache Lucene which allows relevance based search for MongoDB Atlas users.

131 questions
10
votes
1 answer

How do I run an autocomplete $search on multiple fields?

The documentation states that the path needs to be a string and not an array of strings. I just want to confirm that that is in fact the only possibility, and if, in either case, there is a recommended way to do this. e.g. I want to search (with…
Rodrigo Sasaki
  • 7,048
  • 4
  • 34
  • 49
5
votes
2 answers

Mongodb: Text Indexes vs Atlas Search

These two features look pretty simmilar, but Atlas Search is fresh and maybe more powerfull. Is Atlas Search a replacement for Text Indexes in MongoDb? Will Text Indexes be deprecated? Did I missed some essential difference? Is Atlas Search a…
SerG
  • 1,251
  • 4
  • 18
  • 37
5
votes
1 answer

Using MongoDb Atlas full text search with multi-tenant collection ($searchBeta)

I have a MongoDb collection that holds data of thousands of tenants which are separated by a field holding the tenant ID. I want to perform a query that includes full-text search & faceting on a specific tenant (see below). Since the $searchBeta…
Avner Levy
  • 6,601
  • 9
  • 53
  • 92
4
votes
1 answer

MongoDB Atlas search: sort by "searchScore"

I run the following aggregation pipeline and it works well: [ { $search: { text: { query: text, path: 'name', fuzzy: { maxEdits: 2, prefixLength: 0, maxExpansions: 256, }, …
4
votes
1 answer

Atlas search array of objects

I have the following schema: { name: String, phones: [ { number: String, type: String } ] } How do I index phones.number so that I can write something like: collection.aggregate([{ "$search":{…
Mika
  • 5,807
  • 6
  • 38
  • 83
4
votes
1 answer

MongoDB Atlas Search - Multiple terms in search-string with 'and' condition (not 'or')

In the documentation of MongoDB Atlas search, it says the following for the autocomplete operator: query: String or strings to search for. If there are multiple terms in a string, Atlas Search also looks for a match for each term in the string…
4
votes
1 answer

How can I search in arrays of integers with a compound MongoDB Atlas search query?

I am working on a function that helps me find similar documents, sorted by score, using the full-text search feature of MongoDB Atlas. I set my collection index as "dynamic". I am looking for similarities in text fields, such as "name" or…
3
votes
1 answer

Check if MongoDB is connected to MongoDB Atlas

I want to do a text search in MongoDB. In development I use a local mongodb, and in production I use MongoDB Atlas. I want to do a $search Atlas Search if the db I am connected to is MongoDB Atlas. If I'm connected to a local db I want to use…
3
votes
2 answers

Multiple documents having equal search score in MongoDB Atlas Search

Is there a way to boost score for exact match in Atlas search? I'm having issues getting the right/best translation for 'hi' from English to French. After some debugging I discovered that the first three(3) documents returned from my aggregation has…
3
votes
1 answer

Searching numbers as keywords or strings with Mongo Atlas Search (as possible in Elastic Search)

Sometimes it's useful to allow numbers to be treated as keywords or strings when using a search index. For example, suppose I have transaction data something like this: [ { "amount": 715, "description": "paypal payment" }, { "amount": 7500,…
phhu
  • 1,462
  • 13
  • 33
3
votes
1 answer

MongoDB: Search Query to return an object inside the array

I have a Journal Schema which contains an array of notes. I want to implement MongoDB search in my application so that it returns the note that matches the query. Right now it returns the entire Journal Object which contains the matched…
3
votes
1 answer

Why does the Mongodb Atlas Search $search operator not return score=1 on exact query match?

My objective is to implement an effect user-name search aggregation with Mongodb Atlas full text search. It's not going super well. Currently I struggle to understand, why the following does not result in a score of 1? data [{name: "John Doe"},…
DauleDK
  • 3,313
  • 11
  • 55
  • 98
3
votes
2 answers

Is there a way to include a Int32 field in a search index in MongoDB (with Atlas Search)?

I have a collection in a Mongo Atlas DB on which I have a search index including some specific string fields. What I want to do is include a Int32 field in this search index to be able to do a search on this number, along with the other fields. I…
3
votes
1 answer

MongoDB Atlas - $search v/s $match

I'm building a web app using Node and MongoDB Atlas. I need to implement a search bar, which will be used to search a MongoDB collection in 2 particular fields. I was doing some research on the best way to build this, but the Mongo docs are slightly…
3
votes
1 answer

MongoDB Atlas Search autocomplete index wrong scoring

I have a MongoDB Atlas Search index with the autocomplete type on a field name and the following attributes : maxGrams : 15 minGrams : 2 tokenization: edgeGram fold diacritics: true The collection contains the following names : The American The…
1
2 3
8 9