hey! been evaluating typesense recently.. had a qu...
# community-help
a
hey! been evaluating typesense recently.. had a question i've been trying for a few days to get multiple refinement lists to show up in the UI, but to no luck. I'm not very good with npm and these @import js workflows, so i just found an entirely compiled full vanilla JS and got it working that way. how can i get multiple refinementlists?
Copy code
instantsearch.widgets.refinementList({
  container: '#refinement-list',
  attribute: 'tags',
  searchable: true,
  searchablePlaceholder: 'Search Tags',
  showMore: true,
  showMoreLimit: 20,
}),
extra: are search analytics going to be coming to typesense? as in, who searched what and when.. extra2: how many imports can typesense hosted do at one time? I've been doing 1000-2000 imports at a time because higher ones timeout
j
Hi @A Z 1 B I haven't used the non-npm version of instantsearch.js, but did you have to call
search.addWidgets()
to get the first refinementList to show up?
It takes an array of widgets, so I think doing something like
Copy code
instantsearch.addWidgets([instantsearch.widgets.refinementList({...}), instantsearch.widgets.refinementList({...})])
might work...
1
are search analytics going to be coming to typesense? as in, who searched what and when..
We currently don't have server-side analytics in Typesense. Instead I'd recommend using the analytics widget in InstantSearch.js to hook into search queries and send the data to either a web analytics platform like GA / Amplitude, etc or send it to a backend of their choice. With web analytics tools you usually get additional context around search terms like (search terms with the higher conversion rate), which server-side analytics won't be able to do.
1
extra2: how many imports can typesense hosted do at one time? I've been doing 1000-2000 imports at a time because higher ones timeout
I've tried imports of up to 3GB in one import call with millions of records on a 16GB RAM, 4vCPU machine. So the answer to your question would depend on the size of the machine you're using.
1
a
the array doesnt work, just tried two different ways
but apart from that, i'm sold! a great reply and i look forward to using typesense hosted further.
oh whoops, ignore my last post. great! all good
j
Awesome! 🙌
a
is there any way to trouble shoot my typesense cluster? it says that it has imported all of my records, but the filtering counts and the "hits loaded in 10ms" is way off
i've tried
Copy code
client.collections.retrieve
which shows a correct number of documents, but the search interface is a few thousand off
j
Could you share the exact query you’re using?
a
what i should be seeing on the front-end: {1=>7, 3=>593, 2=>13913} 1 = not set, 3 = dental, 2 = medical
what i am seeing (which isnt correct)
message has been deleted
Copy code
"name"=>"mcqs",
  "num_documents"=>14506,
  "num_memory_shards"=>4},
 {"created_at"=>1616719676,

@typesense.collections.retrieve
ETHON: Libcurl initialized
ETHON: performed EASY effective_url=<https://xxx/collections> response_code=200 return_code=ok total_time=0.589906
=> [{"created_at"=>1616732031,
j
Could you also post the search query from the network tab in the browser?
a
num_documents = 14506 13913 + 593 + 7 = 14513
one sec
j
Copy as curl would be ideal
a
Copy code
curl '<https://xxx.typesense.net/multi_search?x-typesense-api-key=XXX>' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: <http://localhost:3000/>' -H 'Content-Type: text/plain' -H 'Origin: <http://localhost:3000>' -H 'DNT: 1' -H 'Connection: keep-alive' --data-raw '{"searches":[{"query_by":"id","num_typos":2,"sort_by":"","highlight_full_fields":"id","collection":"mcqs","q":"*","facet_by":"tags,user,multiple_choice_question_classification,published","filter_by":"published:=[true]","max_facet_values":8,"page":1,"facet_query":"tags:h","per_page":0}]}'
replaced the API key and the url with xxx
j
I see published true as a filter. Could that be filtering out some records
a
ah, damn i can't believe i didnt think of this
you're right. we're good to go
thank you VERY much!
j
Happy to help!
a
also a request -- i am sold on type sense, would be nice to have a GUI to upgrade our deployed typesense search servers in the future
kind of like digitalocean scale up
but will email to upgrade when the time comes
assuming its not on the roadmap, cheers
j
It’s on the roadmap. Until then happy to scale clusters up from our side, if you just send an email to contact@typesense.org with your cluster id
💯 1