Hello everyone, thanks for your reactivity and for...
# community-help
t
Hello everyone, thanks for your reactivity and for this product, it seems like it can cover any case. I have a question we have a multi search using union to mix the results from 4 different collections. I'd like to know if you see a way to bias a bit the
_text_match
sort_by to favor a bit the results from a collections so when typesense does its matching it increase the odds of returning a hit from the collection we want to favor in the union search. What I had in mind: Somthing like increasing from a certain percentage the
text_match
value on this exact collection but I'm not sure this is the right approach
j
CC: @Harpreet Sangar
h
@Thibaut M can you provide a tangible example of this behaviour?
t
Lets say I have 3 collections, cars, motorbike and garages, I want them to be blend in a
union
multisearch sorted by
_text_match
. But as I think users rarely get to the garage page, I want to bias my search so when a user searches a garage, its more likely to be shown a result from garage collection on top of the others. Do you know if there is a way to boost text_match score for a given collections so the odds of having a garage results on top of the other hits is more likely to happen ?
h
If the sorting scores are equivalent of two documents in an union search, we then sort them on the basis of their search index. So if there's a tie between documents of 3 collections, cars, motorbike and garages and the search query is:
Copy code
{
  "union": true,
  "searches": [
    {
      "collection": "garages",
      ...
    },
    {
      "collection": "cars",
      ...
    },
    {
      "collection": "motorbike",
      ...
    }
  ]
}
the
garages
document will appear first in the response.
t
Ok this is good to know. Can I increase the score of garages collection in a way so that lets say: My query is "Toyota" I have a toyota auris car hit which scores 100 I have a specialToyota garage hit which scores 90 I boost on all the request the text match of my collection garage by 20% in a way so specialToyota would score 90 now scores 108 and so goes above the Toyota Auris.
h
This isn't possible right now. Can you open a Github issue for this feature?