Skip to content

A demo that shows how to use typesense-instantsearch-adapter without NPM or YARN

Notifications You must be signed in to change notification settings

typesense/typesense-instantsearch-demo-no-npm-yarn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typesense-instantsearch-demo (without NPM or YARN)

This is a demo that shows you a quick search interface that was built with typesense-instantsearch-adapter.

This is very similar to typesense-instantsearch-demo, but doesn't use NPM or YARN, and instead uses script tags in HTML.

Get started

To run this project locally:

1️⃣ Start Typesense Server

docker run -i -p 8108:8108 -v/tmp/typesense-server-data-1c/:/data typesense/typesense:0.23.1 --data-dir /data --api-key=xyz --listen-port 8108 --enable-cors

Here are more ways to install and start Typesense.

2️⃣ Index Sample Dataset

From the root of this repository run the following curl commands:

curl "http://localhost:8108/collections" \
      -X POST \
      -H "Content-Type: application/json" \
      -H "X-TYPESENSE-API-KEY: xyz" \
      -d '{
            "name": "books",
            "fields": [
              {
                "name": "title",
                "type": "string"
              },
              {
                "name": "authors",
                "type": "string[]",
                "facet": true
              },
              {
                "name": "publication_year",
                "type": "int32",
                "facet": true
              },
              {
                "name": "ratings_count",
                "type": "int32"
              },
              {
                "name": "average_rating",
                "type": "float",
                "facet": true
              }
            ],
            "default_sorting_field": "ratings_count"
          }'
curl "http://localhost:8108/collections/books/documents/import?action=create" \
      -X POST \
      -H "X-TYPESENSE-API-KEY: xyz" \
      --data-binary @./data/books.jsonl

3️⃣ Open index.html

Now open the index.html file in the root of this repo in a web browser, to see the search UI.

About

A demo that shows how to use typesense-instantsearch-adapter without NPM or YARN

Topics

Resources

Stars

Watchers

Forks

Sponsor this project