Is there anything at all that someone may have hid...
# community-help
a
Is there anything at all that someone may have hidden somewhere that could help me get this going?
j
@Alexandro the Typesense Dart library you mentioned is still work in progress. @Harpreet Sangar @Harisaran and @Masahiro Aoki are actively working on it. In the meantime, one thing I'd recommend is using any http library that Dart provides directly from your code. I'm not too familiar with Dart, but there's this package: https://pub.dev/packages/http
Harpreet / Harisaran / Masahiro - feel free to chime in
👍 1
a
please guys, I'm familiarizing myself with http requests in the mean time
j
Could you share which sections of the Algolia docs you followed to get the current search working?
I'm hoping that we can improve our docs to a level that it's as easy as it was for you with Algolia! ... I'm sure it was a lot of effort for Algolia, but one day...
a
sure, let me get it

https://www.youtube.com/watch?v=ig5-4F9OmbM

Us mere mortals, we are more visual... documentation texts turns us into dyslexic apes, so I would highly recommend investing into getting tutorial videos for your service out there... like a bunch!
like for every platform and language
j
I agree, videos tutorials are quite powerful. But it also takes more time to produce compared to written text... So time is the major constraint at this point. Would be totally down if someone wants to contribute video tutorials 😄
Btw, that video tutorial mainly talks about getting data from Firebase to Algolia. Here's the equivalent for Typesense: https://typesense.org/docs/0.20.0/guide/firebase-full-text-search.html
The process is exactly the same, so you can follow almost all of that video tutorial. But for the part where they add code into the cloud function, you want to use the code snippets from the article above.
a
okay this last part was helpful, because I was in that article and it lost me as soon as it mentioned docker so I didn't even go further
but still the most important part, how do we get from keystrokes in a textfield to results below in flutter xD
j
Ooof, that's good feedback. That would only apply if you're self-hosting Typesense. Since you already have a Typesense Cloud cluster going, you can skip the docker pieces
1
but still the most important part, how do we get from keystrokes in a textfield to results below in flutter xD
The video doesn't talk about this does it? Did you follow another tutorial for this to get it working with Algolia?
a
At the end it kinda does, yes
From minute 7:18
and in the description there's the github project that I used to get mine working
j
Ah got it. So once you have your data in Typesense, you want to swap these lines out to Typesense equivalents: https://github.com/Kickbykick/Flutter-Algolia-full-text-search/blob/a4767e2513003a5e7a755bfa214453192b90fb0e/searchpage.dart#L19-L22
a
Let me go play with this and see if I get it working
j
Since the Typesense dart package is not yet ready, you want to instead use the http dart package, and make a GET request to https://xxx.a1.typesense.net/collections/collection_name/documents/search?q=query&query_by=field1,field2&x-typesense-api-key=yyy where
xxx
is your Typesense Cloud cluster ID that you would have received when you generated your API key
yyy
📝 1
See this for the complete list of parameters available for searching: https://typesense.org/docs/0.20.0/api/documents.html#search
📝 1
a
okay, we might be onto something with the http part
🙌 1
j
Btw, when you generated your API key you would received an admin key and a search api key. You want to use the admin key in the cloud function since that has write access to your data. In your app, you want to use the search api key.
a
I wondered that for a second and figured that's how it was
thanks for the proactivity... still checking
👍 1
A firestore-like interface to adding documents and collections would be nice... I'm struggling cuz I'm not an expert in json
j
Could you post a screenshot of how that interface looks like?
a
I will in a minute
ay ay ay
it took me a while to find the documents that I had entered, I was starting to get mad
"Search" is not very intuitive to find your list of added documents
I would suggest just... "Documents"
j
Oh sorry, I meant a screenshot of how the Firestore interface looks like to add Documents
a
Yeah, I know
but I wanted to let you know about this first
j
Got it
a
this is how firestore looks like
j
Ah interesting
a
I can't delete a document
j
It's under "Delete documents" in the sidenav
a
I don't know how to search for one
j
That interface was mainly meant for search
In this example, type in
num_employees:>=0
a
they all have that same value
yup, all gone
j
Right, so it will delete everything
a
oof I should get paid for all this feedback
j
Haha!
Thank you! I really appreciate it
a
Always man
that delete document part... not the best
it feels like a shot in the dark
a delete, edit and duplicate button I feel should be next to every document
j
Yeah, the delete documents feature was something I threw together last minute. Planning to add it to the search (aka documents 🙂 ) page shortly
a
good, let me try to get this working
what does "facet" mean, is this what will be indexed and make the document searchable by?
My app is a food tracker and people will be searching for food names and nutritional value, should I make the "foodName" facet = true?
j
If you want to show filters with counts for any fields, then you want to facet.
1
a
got it
j
foodName is probably not a good facet because it contains a lot of unique values and something that won't help people filter
In songs search for eg, genre is a good filter/facet field
a
yeah, true
question from the audience
once I add a collection, I don't see how I can add additional fields
j
We don't support editing collection fields at the moment, once created (on the roadmap though). So you'd have to create a new collection with the new schema and re-import the data. You can also use the collection alias feature to simplify this process: http://localhost:8080/docs/0.20.0/api/collection-alias.html
a
ay ay ay, that's a problem for me, because my food documents some have more fields, some have less
j
You can mark fields as optional btw
add
optional: true
for a field
So you essentially want to add all possible fields that can occur in any document to the schema, mark the necessary ones as
optional: true
. If you have dynamic field names, you might want to consider using auto-schema detection: https://typesense.org/docs/0.20.0/api/collections.html#with-auto-schema-detection So you don't have to specify every single field name in the schema, and let Typesense auto-detect the data type
a
that auto is what I'll most likely end up doing
okay bro, amazing support... my dopamine ran out
I'll keep working on this tomorrow
Keep improving your product, keep the amazing job and kick Algobiatches ass! They're too expensive!
Nice to meet you, probably will be back here tomorrow
j
Haha, thanks Alexandro!
Nice to meet you too and thank you for all the feedback
1
a
Hey @Jason Bosco like I told Harpreet earlier, if you guys get a demo flutter app working with typesense cloud, let me know and I'll make a video about it, cuz I'm interested in using it myself in my app.
👍 2
this is my channel youtube.com/NoIntroTutorials