typesense / typesense-instantsearch-adapter

A JS adapter library to build rich search interfaces with Typesense and InstantSearch.js
MIT License
361 stars 62 forks source link

error 404 when using useSortBy hook with typesense #192

Open weiklr opened 6 months ago

weiklr commented 6 months ago

Hi,

This is similar to #189, where i'm using a instantsearch hook useSortBy (i'm on instantsearch 7.4.1) .

my items are:

    {
      label: 'Most recent',
      value: `CARROT2024_RECEIPT`,
    },
    {
      label: 'Oldest',
      value: 'CARROT2024_RECEIPT/sort/created_at:asc',
    },
    {
      label: 'Name Asc',
       value: 'CARROT2024_RECEIPT/sort/filename:asc',
    },
    {
      label: 'Name Desc',
      value: 'CARROT2024_RECEIPT/sort/filename:desc',
    },

When i try to format the sortBy items based on the discussion in #189, i saw that call to typesense was made with the right sort by option when i try to sort by file name desc. However i encountered a 404 error as well.

image

and i have the following 404 error instead.

_layout.tsx:223 Error: 404 - Not found.
    at TypesenseInstantsearchAdapter2._validateTypesenseResult (typesense-instantsearch-adapter.js?v=30ae35b4:8128:19)
    at typesense-instantsearch-adapter.js?v=30ae35b4:8024:30
    at Array.map (<anonymous>)
    at TypesenseInstantsearchAdapter2._callee$ (typesense-instantsearch-adapter.js?v=30ae35b4:8023:66)
    at tryCatch (typesense-instantsearch-adapter.js?v=30ae35b4:69:21)
    at Generator.<anonymous> (typesense-instantsearch-adapter.js?v=30ae35b4:161:22)
    at Generator.next (typesense-instantsearch-adapter.js?v=30ae35b4:96:25)
    at asyncGeneratorStep (typesense-instantsearch-adapter.js?v=30ae35b4:374:28)
    at _next (typesense-instantsearch-adapter.js?v=30ae35b4:392:13)
overrideMethod @ console.js:213
Show 38 more frames
Show less

Any advice on this is greatly appreciated.

Metadata

Typesense Version: 0.25.1

BossBele commented 3 months ago

Check this out:

189

Reference to documentation: https://github.com/typesense/typesense-instantsearch-adapter/issues/189#issuecomment-1819427840