#community-help

Utilizing Typesense Multi Search in a NestJS App with Drivers and Vehicles

TLDR Trad was experiencing problems with their multi search in a NestJS app. Jason suggested making changes to the drop_tokens_threshold to fix the issue.

Powered by Struct AI

3

8
1mo
Solved
Join the chat
Oct 24, 2023 (1 month ago)
Trad
Photo of md5-c7485e61e7fd42d0eb4688860e183487
Trad
12:25 PM
Hi every one.

I am using typesense in nestjs app. I have drivers and vehicles collection with a searchFiled attribute to store all the fields i will query on later.
the search field on the driver and the assigned vehicle will be the same and contains the same data.

Ex. the searchField in a driver "searchField": "raniaaref rav 4 22-44518 2020 334",

It contains the driver name 'raniaaref', vehicle model 'rav 4 , vehicle plate '22-44518' , vehicle year '2020' and driver Id '334'.

I have two vehicles with camry model and one single vehicle with 2020 year

I am using multi search and when I query for the term 2020 camry It just return only one vehicle with 2020 model year.

I am expecting to return three vehicles two with camry model and one with 2020 model year.

what is the issue? If any one can help or advice here please?
03:33
Trad
03:33 PM
Jason Kishore Nallan Sabesh
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:15 PM
You want to set drop_tokens_threshold: 1000 as a search parameter

1

04:15
Jason
04:15 PM
Oct 25, 2023 (1 month ago)
Trad
Photo of md5-c7485e61e7fd42d0eb4688860e183487
Trad
05:10 AM
Thank you very much Jason

1

01:57
Trad
01:57 PM
Sorry Jason

But how I can achieve the opposite.

I mean to get the vehicles which are only both Camry and 2020
Thanks 🙏
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:36 PM
You want to set drop_tokens_threshold: 0

1

Oct 26, 2023 (1 month ago)
Trad
Photo of md5-c7485e61e7fd42d0eb4688860e183487
Trad
06:04 AM
Thanks you

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3011 threads (79% resolved)

Join Our Community