question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate to typesense as search backend

See original GitHub issue

Overview

As discussed at #290, we can move to typesense to gain instant-search capability. The search experience should be easier and faster for the user, as it provides typo-tolerant and near real-time search results.

Implementation details

Typesense server will hosted by trustmedis and its contents are crawled hourly by wbw-gsheets-crawler. As discussed by @zainfathoni , there are three indices for now:

  • wbw-gsheets-database
  • wbw-gsheets-faq
  • wbw-gsheets-telemedicine

More indices can be added by making MR into crawler repository.

Fortunately, we have typesense-instantsearch-adapter as a wrapper of Algolia’s instantsearch react components. No need to write components from scratch.

API KEY information

CLICK ME
HOST : public-api.trustmedis.id
PROTOCOL : https
PORT : 443
API KEY : FByczfHEjsTCihgkkYlq2YbAgUKMoyVP

Code

A dirty implementation to instantiate typesense class should be looked like:

  const searchAdapter = new TypesenseInstantSearchAdapter({
    server: {
      apiKey: API_KEY, // search-only API key
      nodes: [
        {
          host: "public-api.trustmedis.id",
          port: "443",
          protocol: "https",
        },
      ],
    },
    additionalSearchParameters: {
      queryBy: ["pertanyaan" , "jawaban"], // for wbw-gsheets-faq index
    },
  });

Current Tasks

Unit & integration tests

End-to-end tests

Implementation

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
ekamuktiacommented, Aug 8, 2021

Sorry, I wasn’t feeling well so I coudn’t work on it. Just pushed #401 update. Basic feature is done, but I still have some problems on the setting & testing.

First, for the setting as I mentioned here https://github.com/kawalcovid19/wargabantuwarga.com/pull/401#issuecomment-888246450

And for testing, since the data is from index, mock data can’t be initialized and passed as props. Tried to find mock for typesense/algolia but still can’t find it so I change the test using hardcoded text -> could result in failed test if the data is updated.

2reactions
famasyacommented, Jul 24, 2021

Well, I’ve also written a quick implementation of this approach in this commit from this stateResults reference mas @zainfathoni . Hope it helps.

PS: pardon for bad styling, 😃)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating from Algolia - Typesense
If an API call succeeds, it means that the data has been written to a majority of the nodes in the cluster and...
Read more >
Running Typesense in Production
Scoped Search API Keys need to be generated in your backend stack, and passed on to the frontend which should then send that...
Read more >
Building Search UIs - Typesense
Let's now install the Typesense InstantSearch adapter, to be able to use InstantSearch with a Typesense backend: To get InstantSearch.js to ...
Read more >
Managing Access to Data - Typesense
This configuration will allow this API Key to only search for documents ... you could have your frontend make an API Call to...
Read more >
Compare Algolia vs ElasticSearch vs Meilisearch vs Typesense
A side-by-side, feature-by-feature comparison of search engine alternatives ... N/A, since it's SaaS only, Requires JVM, and an application backend.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found