Matching A Sequence Of Charatters In A Text Field

Mates,

I am creating a telegram robot where I used mongodb to save details of files from a telegram channel… One of the detail is the file’s name… and is store in the key “file_name”…

The bot I am making is a Auto Filter Robot which when some one enters a text in telegram group the bot willl search the text given by the user in all document in file_name key… and returns matching documents…

The problem I am facing is some file names are mixed with special character for example, supposs a file name is 38_Julio's_Fatacy_2008.mkv and is saved in the field “file_name” In one document… And If a user types Julio's Fatacy or Julios Fatacy I need to fetch that documents with file_name as 38_Julio's_Fatacy_2008.mkv

Someone told me a text index would work as per as my needs… And I created a Text Index on the filed file_name and tried to search the term Julio's Fatacy but it could’nt find that document…

So I would like to know if there is way to slove this? That is searching a sequence of letter from a string filed and returns them even if the sequence is in middle of other letters/charecters like the example name i mentioned above…??

Am currently using Motor Asyncio Driver for Python…

Regards,
Ben

1 Like

If you are in Atlas, you should consider trying Atlas Search rather than a text index.

1 Like

But sadly I am not using atlas search :sweat: :sweat: :sweat: :sweat: