Hi, I am having a hard time configuring the my Ins...
# community-help
j
Hi, I am having a hard time configuring the my InstantSearch.js to reproduce this. Anyone could help me?
Right now this is what I have:
Copy code
additionalSearchParameters: {
    queryBy: 'categories,artname,artistname,color1,color2,tags,dimensions',
    sortBy: 'numsales:desc'
  },
j
@John Doisneau Out of the parameters in the screenshot only
query_by
and
include_fields
can be directly configured via
additionalSearchParameters
in Instantsearch. This is because Instantsearch manages the other parameters internally through their widgets. So to use
facet_by
and
filter_by
you want to use one of the refinement (or filter) widgets that Instantsearch offers. For sort_by, there's the sort widget - [here's](https://github.com/typesense/typesense-instantsearch-adapter/issues/9#issuecomment-710091167) how you configure it for Typesense. If you want to configure default params, have a look at the configure widget.
👍 1
j
OK, thanks, and what about the
Copy code
_text_match:desc
sortBy parameter? Is it an implicit one or do I need to put it in there as well?
j
It's implicitly added as the first sort_by parameter by Typesense
j
OK, that's what I thought
OK, here, I have another question @Jason Bosco: what determines the results set is only, in fact, the
queryBy
and
sortBy
lines, right? Because at some point I had thought the
Include Fields
also were modifying the output...
Now, what I am not understanding though is why I have different results on my website compared to the admin interface of https://cloud.typesense.org/
On the Cloud, the results are much better, and I don't know why...
j
It's most likely that all search parameters are not being included... If you look at the network tab in both the cloud console and your website as search requests are made, you'll be able to get the exact search parameters that are being sent to Typesense and see what the differences in parameters are
j
OK perfect, I will compare!
Comparison On my website:
"sort_by": "numsales:desc",
On the cloud:
"sort_by": "numsales:desc,_text_match:desc",
So it seems I need to add the
_text_match
manually?
j
Hmmm,
_text_match
should get added to the end automatically...
Let's try that though
j
Don't know why but it wasn't. I added it manually and it now works!
j
Glad it works when you added it by hand! But this is different from expected behavior - it should automatically add _text_match at the end if it's not specified. Will take a look shortly
👍 1
@John Doisneau Mind opening a github issue in the typesense repo with a minimal sample dataset reproducing the issue you saw, where
"sort_by": "numsales:desc"
and
"sort_by": "numsales:desc,_text_match:desc"
produced different results? Wasn't replicate it, so I'm wondering if there's something else that might be going on