This message was deleted.
# community-help
s
This message was deleted.
t
@Jason Bosco @Kishore Nallan @Sabesh Bharathi
j
You want to set
drop_tokens_threshold: 1000
as a search parameter
👍 1
t
Thank you very much @Jason Bosco
👍 1
Sorry @Jason Bosco But how I can achieve the opposite. I mean to get the vehicles which are only both Camry and 2020 Thanks 🙏
j
You want to set drop_tokens_threshold: 0
👍 1
t
Thanks you
Hi @Jason Bosco Can you guess why i got this weird results I have two results from typesense the first result when i send the search term as "drive" i got :
{
"facet_counts": [],
"found": 10,
"hits": [
{
"document": {
"avg_score": -1,
"company_id": "6d08cf7c-376c-4690-ba3a-9f7178e0f72f",
"distance": 0,
"driver_ident": "323223",
"email": "drivernover1@yahoo.com",
"entityType": "drivers",
"fusionauth_id": "e83a987b-73da-40fa-86d1-54ea8d59fe6c",
"id": "655b2ed946fc8bd4287d4b48",
"make": "toyota",
"model": "camry",
"name": "driver2",
"plate": "70-46693",
"searchField": "driver2 camry 70-46693 2022 323223 toyota",
"status": "available",
"trips_count": 0,
"vehicle_id": "6555ebfd6aab77f3513aea13",
"year": 2022
},
"highlight": {
"searchField": {
"matched_tokens": [
"drive"
],
"snippet": "<mark>drive</mark>r2 camry 70-46693 2022 323223 toyota"
}
},
"highlights": [
{
"field": "searchField",
"matched_tokens": [
"drive"
],
"snippet": "<mark>drive</mark>r2 camry 70-46693 2022 323223 toyota"
}
],
"text_match": 578730089005449300,
"text_match_info": {
"best_field_score": "1108074561536",
"best_field_weight": 15,
"fields_matched": 1,
"score": "578730089005449337",
"tokens_matched": 1
}
},
{
"document": {
"avg_score": 91.06184512434513,
"company_id": "6d08cf7c-376c-4690-ba3a-9f7178e0f72f",
"distance": 138.01999999999998,
"driver_ident": "23230202",
"email": "drivernov1@yahoo.com",
"entityType": "drivers",
"fusionauth_id": "716b5471-ea8c-44e6-b585-7019e0c29d52",
"id": "655b2eac46fc8bd4287d4b39",
"make": "toyota",
"model": "highlander",
"name": "driver1",
"plate": "70-45679",
"searchField": "driver1 highlander 70-45679 2022 23230202 toyota",
"status": "active",
"trips_count": 14,
"vehicle_id": "6555eb0d6aab77f3513ae9fb",
"year": 2022
},
"highlight": {
"searchField": {
"matched_tokens": [
"drive"
],
"snippet": "<mark>drive</mark>r1 highlander 70-45679 2022 23230202 toyota"
}
},
"highlights": [
{
"field": "searchField",
"matched_tokens": [
"drive"
],
"snippet": "<mark>drive</mark>r1 highlander 70-45679 2022 23230202 toyota"
}
],
"text_match": 578730089005449300,
"text_match_info": {
"best_field_score": "1108074561536",
"best_field_weight": 15,
"fields_matched": 1,
"score": "578730089005449337",
"tokens_matched": 1
}
}
],
"out_of": 23,
"page": 5,
"request_params": {
"collection_name": "drivers",
"per_page": 2,
"q": "drive"
},
"search_cutoff": false,
"search_time_ms": 1
}
the second one when i send search term as "driver" i got
{
"facet_counts": [],
"found": 9,
"hits": [
{
"document": {
"avg_score": -1,
"company_id": "6d08cf7c-376c-4690-ba3a-9f7178e0f72f",
"distance": 0,
"driver_ident": "323223",
"email": "drivernover1@yahoo.com",
"entityType": "drivers",
"fusionauth_id": "e83a987b-73da-40fa-86d1-54ea8d59fe6c",
"id": "655b2ed946fc8bd4287d4b48",
"make": "toyota",
"model": "camry",
"name": "driver2",
"plate": "70-46693",
"searchField": "driver2 camry 70-46693 2022 323223 toyota",
"status": "available",
"trips_count": 0,
"vehicle_id": "6555ebfd6aab77f3513aea13",
"year": 2022
},
"highlight": {
"searchField": {
"matched_tokens": [
"driver"
],
"snippet": "<mark>driver</mark>2 camry 70-46693 2022 323223 toyota"
}
},
"highlights": [
{
"field": "searchField",
"matched_tokens": [
"driver"
],
"snippet": "<mark>driver</mark>2 camry 70-46693 2022 323223 toyota"
}
],
"text_match": 578730089005449300,
"text_match_info": {
"best_field_score": "1108074561536",
"best_field_weight": 15,
"fields_matched": 1,
"score": "578730089005449337",
"tokens_matched": 1
}
}
],
"out_of": 23,
"page": 5,
"request_params": {
"collection_name": "drivers",
"per_page": 2,
"q": "driver"
},
"search_cutoff": false,
"search_time_ms": 1
}
I don't know why it excludes
driver1
from the result.
searchField
is the field for searching.
this is the setting
const searchParameters = {
q: query.term,
query_by: 'searchField',
num_typos: 1,
min_len_1typo: 5,
drop_tokens_threshold: 0,
filter_by: filterBy,
sort_by: sortBy,
per_page: query.perPage,
page: query.page,
};
j
Could you try setting max_candidates: 1000 to see if that helps?
t
I tried it but it dose not work
@Jason Bosco
j
To be able to debug this further, could you give me a set of curl commands like this that creates a collection with a schema like yours, indexes a small number of records and does a search request?