GithubHelp home page GithubHelp logo

typesense / docusaurus-theme-search-typesense Goto Github PK

View Code? Open in Web Editor NEW
63.0 6.0 15.0 1.85 MB

A fork of the awesome @docusaurus/theme-search-algolia library customized to work with Typesense

Home Page: https://typesense.org/docs/guide/docsearch.html

License: MIT License

JavaScript 47.08% CSS 5.68% TypeScript 47.24%
typesense docsearch search-ui docusaurus2 docusaurus docusaurus-plugin

docusaurus-theme-search-typesense's Introduction

docusaurus-theme-search-typesense

Typesense search component for Docusaurus powered documentation sites.

This is a fork of the awesome @docusaurus/theme-search-algolia library customized to work with Typesense.

About Typesense

If you're new to Typesense, it is an open source search engine that is simple to use, run and scale, with clean APIs and documentation.

Think of it as an open source alternative to Algolia and an easier-to-use, batteries-included alternative to ElasticSearch. Get a quick overview from this guide.

Documentation

Read detailed step-by-step instructions on how to first setup the DocSearch scraper and then install this plugin here: https://typesense.org/docs/latest/guide/docsearch.html.

Help

If you have any questions or run into any problems, please create a Github issue and we'll try our best to help.

docusaurus-theme-search-typesense's People

Contributors

ako92 avatar armano2 avatar bbkgh avatar buckymaler avatar burmecia avatar endiliey avatar fharper avatar francoischalifour avatar hobadams avatar jasonbosco avatar lex111 avatar octogonz avatar rarkins avatar rdil avatar samchou19815 avatar shirshendubhowmick avatar shortcuts avatar simek avatar slorber avatar tetunori avatar yangshun avatar ykzts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docusaurus-theme-search-typesense's Issues

typesenseSearchParameters.filter_by config doesn't apply in search results page

Hi. When i set filter_by:"" in typesenseSearchParameters, searching in modal works correctly but in search results page (show all X results) this option doesn't applies and accordingly returns nothing.

correct request in search modal:

curl 'https://typesense.mysite.com/multi_search?x-typesense-api-key=KEY' -X POST  -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Content-Type: text/plain' -H 'Origin: http://localhost:3000' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: http://localhost:3000/' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: cross-site' -H 'TE: trailers' --data-raw '{"searches":[{"collection":"coll1","q":"kube","query_by":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content","include_fields":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content,anchor,url,type,id","highlight_full_fields":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content","group_by":"url","group_limit":3,"filter_by":""}]}'

incorrect request in search page (mysite.com/search?q=kube)

curl 'https://typesense.misite.com/multi_search?x-typesense-api-key=KEY' -X POST  -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Content-Type: text/plain' -H 'Origin: http://localhost:3000' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: http://localhost:3000/' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: cross-site' -H 'TE: trailers' --data-raw '{"searches":[{"query_by":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content","include_fields":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content,anchor,url,type,id","highlight_full_fields":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content","group_by":"url","group_limit":3,"filter_by":"language:=[`en`] && docusaurus_tag:=[`default`,`docs-default-current`]","sort_by":"","collection":"coll","q":"kube","facet_by":"language,docusaurus_tag","page":1,"per_page":15},{"query_by":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content","include_fields":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content,anchor,url,type,id","highlight_full_fields":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content","group_by":"url","group_limit":3,"filter_by":"docusaurus_tag:=[`default`,`docs-default-current`]","sort_by":"","collection":"coll","q":"kube","facet_by":"language","page":1,"per_page":1},{"query_by":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content","include_fields":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content,anchor,url,type,id","highlight_full_fields":"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content","group_by":"url","group_limit":3,"filter_by":"language:=[`en`]","sort_by":"","collection":"coll","q":"kube","facet_by":"docusaurus_tag","page":1,"per_page":1}]}'

Metadata

Typsense Version: 0.21.0

Docusaurus Version: 2.0.0-beta.0

Plugin Version: 0.0.5

Configuration questions

Hi!
We have the Typesense search added to our documentation site, but so far, I've been unable to configure it in a way that it gives relevant results. I have also been unable to find any material on how to really configure the plugin other than simply adding it to the website.

Specifically I'm looking to have the following set up:

  • Filter to search within given subsets of pages. This is important, as the documentation page includes the docs of several separate products - so we have several folders within the docs folder in the Docusaurus project.
  • Filter to search within specific versions os specific products
  • Differentiate and prioritize based on what type of element is matched. That is, page title, subheading within a page, or any other piece of text.

I see that there is a possibility to have different dropdowns appear on the 'All results' page, but I cannot find how and where to configure them.

Thanks in advance for the help!

@docusaurus/core and @docusaurus/theme-common are out of date

I get the following errors when installing this library:

➤ YN0060: │ @docusaurus/core is listed by your project with version 3.0.1, which doesn't satisfy what docusaurus-theme-search-typesense (pe3d48) requests (3.0.0).
➤ YN0060: │ @docusaurus/theme-common is listed by your project with version 3.0.1, which doesn't satisfy what docusaurus-theme-search-typesense (pf65e6) requests (3.0.0).

Can these be updated? Additionally, maybe the ranges should be less strict to allow for any version in the range between 3.0.0 >= x < 4.0.0 ?

DocsPreferredVersionContextProvider error when launching page.

Description

Docusaurus site versions 2.0.0-beta.16 and 2.0.0-beta.15 do not work with the typesense search plugin. Starting page after configuring the website results in the following error .

This page crashed.
Can't find docs preferred context, maybe you forgot to use the "DocsPreferredVersionContextProvider"?

Steps to reproduce

After creating a new docusaurus site using the command on their getting started page:

npx create-docusaurus@latest my-website classic

Adding "docusaurus-theme-search-typesense": "^0.3.0", to the dependencies section in the package.json file

Installing the plugin using

 npm install --legacy-peer-deps

and configuring my config.js file I launch my website using npm run start and see the following error

This page crashed.
Can't find docs preferred context, maybe you forgot to use the "DocsPreferredVersionContextProvider"?

Expected Behavior

Website should load and search bar should be present.

Actual Behavior

Website crashes

Metadata

Typsense Version: docusaurus-theme-search-typesense": "^0.3.0"

OS: Windows and Mac

"Please use snake_cased versions" warning

Description

After upgrading to Docusaurus 2.0.0-beta.17, I now see this warning during the build:

[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in 
additionalSearchParameters instead of camelCased parameters. 
For example: Use query_by instead of queryBy. camelCased parameters will be 
deprecated in a future version. We're making this change so that parameter names 
are identical to the ones sent to Typesense (which are all snake_cased), and to also keep 
the types for these parameters in sync with the types defined in typesense-js.
√ Client: Compiled successfully in 4.70m
√ Server: Compiled successfully in 4.71m

My repo does not configure additionalSearchParameters anywhere.

I think the problem is caused by docusaurus-theme-search-typesense:

const typesenseInstantSearchAdapter = new TypesenseInstantSearchAdapter({
server: typesenseServerConfig,
additionalSearchParameters: {
queryBy:
'hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content',
includeFields:

Should we just make a PR to rename queryBy to query_by?

Metadata

Typsense Version: [email protected]

OS: Windows

Update for Docusaurus 2.2.0

Docusaurus 2.2.0 has been released. Version 0.7.0-0 of the plugin is not compatible due to dependency conflicts.

Maybe it is possible to specify a minimum version for the docusaurus dependencies, so there does not have to be an update of the plugin for every release? I don't know how stable the docusaurus apis are...

Build fails when config includes redocusaurus and docusaurus-theme-search-typesense

Description

Hi

I'm getting a build error when I compile with 2 plugins in the same config

  • redocusaurus 1.3.0
  • docusaurus-theme-search-typesense 0.7.0-0

I also wanted to note that I only run into this error when running npm run build if i do npm start everything works fine with both plugins available in the docusaurus config.

I've tried a mix of the following

  • rm -rf node_modules package-lock.json and reinstall
  • downgrading docusaurus to v2.0.1
  • upgrading to docusaurus v2.1.0

I've noticed that if I were to comment out the redocusaurus config in presets of docusaurus.config.js OR themes:['docusaurus-theme-search-typesense'] the build happens smoothly

docusaurus.config.js

  presets: [
    [
      '@docusaurus/preset-classic',
      /** @type {import('@docusaurus/preset-classic').Options} */
      ({
        docs: {
          sidebarPath: require.resolve('./sidebars.js'),
        },
        blog: false,
        theme: {
          customCss: require.resolve('./src/css/custom.css'),
        },
      }),
    ],
    [
      'redocusaurus',
      {
        specs: [
          {
            spec: require.resolve('./static/api_spec/open-api-spec.yml'),
            route: '/api',
          },
        ],
        theme: {
          primaryColor: '#2e8555',
          primaryColorDark: '#25c2a0'
        },
      },
    ],
  ],
  themes: ['docusaurus-theme-search-typesense'],

package.json

{
  "name": "json-api-docs",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "docusaurus": "docusaurus",
    "start": "docusaurus start",
    "build": "docusaurus build",
    "swizzle": "docusaurus swizzle",
    "deploy": "docusaurus deploy",
    "clear": "docusaurus clear",
    "serve": "docusaurus serve",
    "write-translations": "docusaurus write-translations",
    "write-heading-ids": "docusaurus write-heading-ids",
    "typecheck": "tsc"
  },
  "dependencies": {
    "@docusaurus/core": "^2.1.0",
    "@docusaurus/preset-classic": "^2.1.0",
    "@mdx-js/react": "^1.6.22",
    "clsx": "^1.2.1",
    "docusaurus-theme-search-typesense": "^0.7.0-0",
    "prism-react-renderer": "^1.3.5",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "redocusaurus": "^1.3.0"
  },
  "devDependencies": {
    "@docusaurus/module-type-aliases": "^2.1.0",
    "@tsconfig/docusaurus": "^1.0.5",
    "typescript": "^4.7.4"
  },
  "browserslist": {
    "production": [
      ">0.5%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "engines": {
    "node": ">=16.14"
  }
}

error message

[INFO] [en] Creating an optimized production build...
✔ Client
✖ Server
  Compiled with some errors in 15.89s

main:55529
                {}.DEBUG = namespaces;
                  ^

SyntaxError: Unexpected token '.'
[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.
    at .../json-api-docs/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24
    at .../json-api-docs/node_modules/webpack/lib/MultiCompiler.js:554:14
    at processQueueWorker (.../json-api-docs/node_modules/webpack/lib/MultiCompiler.js:491:6)
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
[INFO] Docusaurus version: 2.1.0
Node version: v16.14.2

Steps to reproduce

  • implement redocusaurus
  • implement searchbar utilizing typesense
  • npm run build with both redocusaurus and docusaurus-theme-search-typesense enabled in the docusaurus config

Expected Behavior

  • I would expect the build to be successful / compete

Actual Behavior

  • Build fails when compiling the "server"

Metadata

Typsense Version:
0.7.0-0

OS:
MacOS Monterey 12.6

Module not found: Can't resolve '@docusaurus/Translate' in

Description

Hi i need to implement typesense searchBar in my docs project
i)have install npm install docusaurus-theme-search-typesense --save package
ii)i have add below details
{themes: ['docusaurus-theme-search-typesense'],
themeConfig: {
typesense: {
typesenseCollectionName: 'docs',
typesenseServerConfig: {
nodes: [
{
host: '127.0.0.1',
port: 3000,
protocol: 'http',
},
],
apiKey: 'kcAuUM',
},
typesenseSearchParameters: {},
// Optional
contextualSearch: true,
},
},}

Steps to reproduce

Expected Behavior

To show typesense search bar

Actual Behavior

Screenshot from 2022-02-03 18-11-42

Metadata

Typsense Version:

OS:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map')

Description

Hello,

I am a brand new TypeSense user. I am trying to move my existing Docusaurus website from Algolia --> TypeSense. I followed the steps from the documentation, and I cannot get it working.

My Docusaurus site is published to: https://isaacscript.github.io/

When attempting to type anything into the search, I get the following error in the JavaScript console:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map')
    at t.value (37702.a034fb89.js:2:3949)
    at t.value (37702.a034fb89.js:2:8672)
    at 90888.529c7e8f.js:1:56429
    at p (37702.a034fb89.js:2:105125)
    at Generator.<anonymous> (37702.a034fb89.js:2:106462)
    at Generator.next (37702.a034fb89.js:2:105488)
    at jt (90888.529c7e8f.js:1:55241)
    at i (90888.529c7e8f.js:1:56585)

More Info

I am self-hosting TypeSense. I can see what the version is from the log file:

I20230208 07:07:05.562175 480505 typesense_server_utils.cpp:357] Starting Typesense 0.24.0

My "typesense-server.ini" looks like this:

; Typesense Configuration

[server]

api-address = 0.0.0.0
api-port = 8108
data-dir = /var/lib/typesense
api-key = 9AiKF0AGD145wC9fc4NafATcCam89XT7v2NxGf2ymFucN7b6
log-dir = /var/log/typesense

And the config in my "docusaurus.config.js" file is this:

      typesense: {
        typesenseCollectionName: "isaacscript",
        typesenseServerConfig: {
          nodes: [
            {
              host: "isaacracing.net",
              port: 8108,
              protocol: "https",
            },
          ],
          apiKey: "9AiKF0AGD145wC9fc4NafATcCam89XT7v2NxGf2ymFucN7b6",
        },

        typesenseSearchParameters: {},

        contextualSearch: true,
      },

For reference, the "docusaurus.config.js" file is located here:
https://github.com/IsaacScript/isaacscript/blob/main/packages/docs/docusaurus.config.js

Furthermore, I am using the following version of the plugin, which is located in my "package.json" file:

    "docusaurus-theme-search-typesense": "^0.9.0",

For reference, the "package.json" file is located here:
https://github.com/IsaacScript/isaacscript/blob/main/package.json

Can't resolve '../../client' error after swizzling SearchBar

Description

When I try to swizzle the docusaurus-theme-search-typesense SearchBar component it fails to compile docusaurus with an error.

Steps to reproduce

  1. Run yarn run swizzle docusaurus-theme-search-typesense SearchBar
  2. Select the 'Eject' option
  3. Run yarn start

Expected Behavior

Local Docusaurus will start without error with a copied version of the typesense searchbar as it was previously

Actual Behavior

Docusaurus launches with an error:

Compiled with problems:X

ERROR in ./src/theme/SearchBar/index.js 7:143-199

Module not found: Error: Can't resolve '../../client' in '<redacted>\content\src\theme\SearchBar'

Metadata

docusaurus/core: 2.2.0
docusaurus-theme-search-typesense: 0.8.0

Placement of search box

Hi :)
So I followed the instructions on https://typesense.org/docs/guide/docsearch.html#option-a-docusaurus-powered-sites and have the search box in the top right of the page. It seems to work OK in that I get some results back (I'll tune later) - but I was curious if there was a way to change the position of the search box from the top right to the center of the page easily.

If not, what will I have to change in the code to change the position of the box. Could you help out with this?

Thanks
Arvind

Case sensitive when searching in Cyrillic

Description

Case sensitive when searching in Cyrillic.

Steps to reproduce

Go to Search field, type keyword, for example in cyryllic - пример. After type same keyword in uppercase (ПРИМЕР).

Expected Behavior

Search resulst are equal

Actual Behavior

Search resulst are not equal

Metadata

Typesense Version: typesense:0.24.0
Docusaurus Version: 2.2.0
docusaurus-theme-search-typesense Version: 0.8.0

Error NPM Installing when using Docusaurus 2.4.1

Description

The package.json has all docusaurus components hardcoded to 2.4.0, not allowing to upgrade to the recent release of 2.4.1

Steps to reproduce

  1. In any package that uses typesense/docusaurus-theme-search-typesense, upgrade docusaurus to 2.4.1
  2. run npm install or yarn install

Expected Behavior

npm/yarn install works

Actual Behavior

npm/yarn install throws error

example npm error

npm ERR! Found: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR!   @docusaurus/core@"2.4.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @docusaurus/core@"2.4.0" from [email protected]

Metadata

Typesense Version: 0.11.0

OS: MacOS 13.3.1

Add support for @docusaurus/core 3.0.0

Description

This library throws an error when updating to @docusaurus/core version 3.0.0.

Steps to reproduce

Upgrade to @docusaurus/[email protected] in any repository that uses docusaurus-theme-search-typesense.

Expected Behavior

No errors on package installation

Actual Behavior

error thrown

npm install

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR!   @docusaurus/core@"3.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @docusaurus/core@"2.4.3" from [email protected]
npm ERR! node_modules/docusaurus-theme-search-typesense
npm ERR!   dev docusaurus-theme-search-typesense@"^0.13.1" from the root project

Metadata

Typesense Version: 1.5.3

OS: mac (intel)

Not working after the latest docusaurus update

Description

After installing the latest docusaurus update an error is happening during dev server startup.

Steps to reproduce

  1. Install typesense with the latest docusaurus beta version as explained here: https://docusaurus.io/docs/search#using-typesense-docsearch

Expected Behavior

Dev server is starting without errors as before the update to docusaurus version 2.0.0-beta.13.

Actual Behavior

The following error message is displayed when starting the dev server:
Module not found: Error: Can't resolve '@theme/hooks/useContextualSearchFilters' in 'C:\Dev\swg\node_modules\docusaurus-theme-search-typesense\src\theme\hooks'
client (webpack 5.64.2) compiled with 1 error

Metadata

Typsense Version:

[email protected] | MIT | deps: 11 | versions: 5
Typesense search component for Docusaurus.
https://github.com/typesense/docusaurus-theme-search-typesense#readme

dist
.tarball: https://registry.npmjs.org/docusaurus-theme-search-typesense/-/docusaurus-theme-search-typesense-0.1.0.tgz
.shasum: 355afa3fd9407074a1e6e12d4dd385a214ba358d
.integrity: sha512-agdbDigezghgkTjdYEfKB3CB2H0OVBoYNjm4fhPPbCiACzelSRF9dDkiuiqAU6HcgUSMx3T7p/EQD5kW1/gpHQ==
.unpackedSize: 52.8 kB

dependencies:
@docusaurus/core: 2.0.0-beta.4 @docusaurus/utils: 2.0.0-beta.4 eta: ^1.12.1 typesense-instantsearch-adapter: ^2.2.0-1
@docusaurus/theme-common: 2.0.0-beta.4 algoliasearch-helper: ^3.3.4 lodash: ^4.17.20 typesense: ^0.14.0
@docusaurus/utils-validation: 2.0.0-beta.4 clsx: ^1.1.1 typesense-docsearch-react: ^0.0.1

NPM version:
npm: '8.1.2',
node: '16.13.1'

OS:
Windows 10 Enterprise 21H1 latest

Support for Docusaurus 3.3.2

Description

Add support for Docusaurus 3.3.2.

Steps to reproduce

Update to the following dependency versions in package.json:

@docusaurus/core: 3.3.2
@docusaurus/module-type-aliases: 3.3.2
@docusaurus/preset-classic: 3.3.2
@docusaurus/theme-live-codeblock: ^3.3.2
@docusaurus/theme-mermaid: ^3.3.2
@docusaurus/types: 3.3.2

Expected Behavior

npm install completes without issue.

Actual Behavior

npm install fails with:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR!   @docusaurus/core@"3.3.2" from the root project
npm ERR!   @docusaurus/core@"3.3.2" from @docusaurus/[email protected]
npm ERR!   node_modules/@docusaurus/plugin-debug
npm ERR!     @docusaurus/plugin-debug@"3.3.2" from @docusaurus/[email protected]
npm ERR!     node_modules/@docusaurus/preset-classic
npm ERR!       @docusaurus/preset-classic@"3.3.2" from the root project
npm ERR!   24 more (@docusaurus/plugin-google-analytics, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @docusaurus/core@"3.2.1" from [email protected]
npm ERR! node_modules/docusaurus-theme-search-typesense
npm ERR!   docusaurus-theme-search-typesense@"^0.18.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR!   peer @docusaurus/core@"3.2.1" from [email protected]
npm ERR!   node_modules/docusaurus-theme-search-typesense
npm ERR!     docusaurus-theme-search-typesense@"^0.18.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Metadata

Typesense Version: 0.25.1

OS: Ubuntu 22.04.3 LTS

Search bar results link and SearchPage don't load new results after first view

Description

When I use the search box for a second time it fails to reload the search.

Steps to reproduce

  1. Go to home
  2. Search for content using search bar
  3. Scroll to bottom results link
  4. Select results link and view all results
  5. Use the search bar for another term
  6. Scroll to bottom results link
  7. Select results link and view
  8. Repeat 5-7

Expected Behavior

New results will show for the new search terms

Actual Behavior

Old results from first search term continue to show

Metadata

Typesense Version: 0.9.0 (docusaurus-theme-search-typesense)

OS:
Windows Chrome 109.0.5414.120 (Official Build) (64-bit)
search-bug.webm

Support for Docusaurus 3.1.0

Description

Support for Docusaurus 3.1.0

Steps to reproduce

Upgrade to Docusaurus 3.1.0

Expected Behavior

N/A

Actual Behavior

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: @docusaurus/[email protected]
npm WARN node_modules/@docusaurus/core
npm WARN @docusaurus/core@"3.1.0" from the root project
npm WARN 11 more (@docusaurus/plugin-content-blog, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @docusaurus/core@"3.0.1" from [email protected]
npm WARN node_modules/docusaurus-theme-search-typesense
npm WARN docusaurus-theme-search-typesense@"^0.14.1-0" from the root project

Metadata

Typesense Version:

0.14.1

OS:

Windows 11

Support for Docusaurus 3.4.0

Description

Add support for Docusaurus 3.4.0.

Steps to reproduce

Update to the following dependency versions in package.json:

@docusaurus/core: 3.4.0
@docusaurus/module-type-aliases: 3.4.0
@docusaurus/preset-classic: 3.4.0
@docusaurus/theme-live-codeblock: ^3.4.0
@docusaurus/theme-mermaid: ^3.4.0
@docusaurus/types: 3.4.0

Expected Behavior

npm install completes without issue.

Actual Behavior

npm install fails with:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR!   @docusaurus/core@"3.4.0" from the root project
npm ERR!   @docusaurus/core@"3.4.0" from @docusaurus/[email protected]
npm ERR!   node_modules/@docusaurus/plugin-debug
npm ERR!     @docusaurus/plugin-debug@"3.4.0" from @docusaurus/[email protected]
npm ERR!     node_modules/@docusaurus/preset-classic
npm ERR!       @docusaurus/preset-classic@"3.4.0" from the root project
npm ERR!   24 more (@docusaurus/plugin-google-analytics, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @docusaurus/core@"3.3.2" from [email protected]
npm ERR! node_modules/docusaurus-theme-search-typesense
npm ERR!   docusaurus-theme-search-typesense@"^0.19.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR!   peer @docusaurus/core@"3.3.2" from [email protected]
npm ERR!   node_modules/docusaurus-theme-search-typesense
npm ERR!     docusaurus-theme-search-typesense@"^0.19.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Metadata

Typesense Version: 0.25.1

OS: Ubuntu 22.04.4 LTS

Page crashes whenever clicking the SearchBar

Description

Clicking on the SearchBar crashes the page.

Expected Behavior

The Search modal should open.

Actual Behavior

The full error on the console:

Uncaught TypeError: Cannot read properties of undefined (reading 'sendApiKeyAsQueryParam')
    at new SearchClient (SearchClient.js?414f:13:1)
    at eval (useSearchClient.js?34ab:15:1)
    at mountMemo (react-dom.development.js?ac89:15846:1)
    at Object.useMemo (react-dom.development.js?ac89:16219:1)
    at Object.useMemo (react.development.js?1b7e:1532:1)
    at useSearchClient (useSearchClient.js?34ab:14:1)
    at DocSearchModal (DocSearchModal.js?ee63:78:1)
    at renderWithHooks (react-dom.development.js?ac89:14985:1)
    at mountIndeterminateComponent (react-dom.development.js?ac89:17811:1)
    at beginWork (react-dom.development.js?ac89:19049:1)
react-dom.development.js?ac89:20085 The above error occurred in the <DocSearchModal> component:

    at DocSearchModal (webpack-internal:///./node_modules/typesense-docsearch-react/dist/esm/DocSearchModal.js:47:38)
    at DocSearch (webpack-internal:///./node_modules/docusaurus-theme-search-typesense/lib/theme/SearchBar/index.js:32:802)
    at SearchBar (webpack-internal:///./node_modules/docusaurus-theme-search-typesense/lib/theme/SearchBar/index.js:44:1896)
    at div
    at NavbarSearch (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/Navbar/Search/index.js:13:36)
    at SearchNavbarItem (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/NavbarItem/SearchNavbarItem.js:13:40)
    at NavbarItem (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/NavbarItem/index.js:14:116)
    at NavbarItems (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/Navbar/Content/index.js:23:128)
    at div
    at div
    at NavbarContentLayout (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/Navbar/Content/index.js:23:594)
    at NavbarContent (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/Navbar/Content/index.js:23:1076)
    at nav
    at NavbarLayout (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/Navbar/Layout/index.js:19:413)
    at Navbar
    at NavbarSecondaryMenuDisplayProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/navbarSecondaryMenu/display.js:19:327)
    at NavbarMobileSidebarProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/navbarMobileSidebar.js:21:423)
    at NavbarSecondaryMenuContentProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/navbarSecondaryMenu/content.js:14:156)
    at NavbarProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/utils/navbarUtils.js:20:38)
    at HtmlClassNameProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/utils/metadataUtils.js:27:56)
    at PluginHtmlClassNameProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/utils/metadataUtils.js:30:52)
    at DocsPreferredVersionContextProviderUnsafe (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/docsPreferredVersion.js:31:392)
    at DocsPreferredVersionContextProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/docsPreferredVersion.js:34:60)
    at ScrollControllerProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/utils/scrollUtils.js:18:488)
    at AnnouncementBarProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/announcementBar.js:23:459)
    at ColorModeProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/colorMode.js:25:1255)
    at eval (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/utils/reactUtils.js:65:19)
    at LayoutProvider (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/Layout/Provider/index.js:18:655)
    at Layout (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/Layout/index.js:24:33)
    at DocPageLayout (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/DocPage/Layout/index.js:17:37)
    at DocsSidebarProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/docsSidebar.js:17:43)
    at DocsVersionProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/docsVersion.js:15:43)
    at HtmlClassNameProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/utils/metadataUtils.js:27:56)
    at DocPage (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/DocPage/index.js:21:788)
    at RouteContextProvider (webpack-internal:///./node_modules/@docusaurus/core/lib/client/routeContext.js:14:70)
    at LoadableComponent (webpack-internal:///./node_modules/react-loadable/lib/index.js:138:32)
    at Route (webpack-internal:///./node_modules/react-router/esm/react-router.js:647:29)
    at Switch (webpack-internal:///./node_modules/react-router/esm/react-router.js:849:29)
    at Route (webpack-internal:///./node_modules/react-router/esm/react-router.js:647:29)
    at ClientLifecyclesDispatcher (webpack-internal:///./node_modules/@docusaurus/core/lib/client/ClientLifecyclesDispatcher.js:15:271)
    at PendingNavigation (webpack-internal:///./node_modules/@docusaurus/core/lib/client/PendingNavigation.js:15:138)
    at Root (webpack-internal:///./node_modules/@docusaurus/core/lib/client/theme-fallback/Root/index.js:18:25)
    at BrowserContextProvider (webpack-internal:///./node_modules/@docusaurus/core/lib/client/browserContext.js:19:126)
    at DocusaurusContextProvider (webpack-internal:///./node_modules/@docusaurus/core/lib/client/docusaurusContext.js:19:495)
    at ErrorBoundary (webpack-internal:///./node_modules/@docusaurus/core/lib/client/exports/ErrorBoundary.js:14:246)
    at App (webpack-internal:///./node_modules/@docusaurus/core/lib/client/App.js:26:241)
    at Router (webpack-internal:///./node_modules/react-router/esm/react-router.js:266:30)
    at BrowserRouter (webpack-internal:///./node_modules/react-router-dom/esm/react-router-dom.js:57:35)
    at r (webpack-internal:///./node_modules/react-helmet-async/lib/index.module.js:16:7320)

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
logCapturedError @ react-dom.development.js?ac89:20085
useRouteContext.js?4ab8:6 Uncaught Error: Unexpected: no Docusaurus route context found
    at useRouteContext (useRouteContext.js?4ab8:6:1)
    at PluginHtmlClassNameProvider (metadataUtils.tsx?5c9e:102:1)
    at renderWithHooks (react-dom.development.js?ac89:14985:1)
    at mountIndeterminateComponent (react-dom.development.js?ac89:17811:1)
    at beginWork (react-dom.development.js?ac89:19049:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js?ac89:3945:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js?ac89:3994:1)
    at invokeGuardedCallback (react-dom.development.js?ac89:4056:1)
    at beginWork$1 (react-dom.development.js?ac89:23964:1)
    at performUnitOfWork (react-dom.development.js?ac89:22779:1)
react-dom.development.js?ac89:20085 The above error occurred in the <PluginHtmlClassNameProvider> component:

    at PluginHtmlClassNameProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/utils/metadataUtils.js:30:52)
    at DocsPreferredVersionContextProviderUnsafe (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/docsPreferredVersion.js:31:392)
    at DocsPreferredVersionContextProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/docsPreferredVersion.js:34:60)
    at ScrollControllerProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/utils/scrollUtils.js:18:488)
    at AnnouncementBarProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/announcementBar.js:23:459)
    at ColorModeProvider (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/colorMode.js:25:1255)
    at eval (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/utils/reactUtils.js:65:19)
    at LayoutProvider (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/Layout/Provider/index.js:18:655)
    at Layout (webpack-internal:///./node_modules/@docusaurus/theme-classic/lib/theme/Layout/index.js:24:33)
    at ErrorBoundary (webpack-internal:///./node_modules/@docusaurus/core/lib/client/exports/ErrorBoundary.js:14:246)
    at Error (webpack-internal:///./node_modules/@docusaurus/core/lib/client/theme-fallback/Error/index.js:15:641)
    at ErrorBoundary (webpack-internal:///./node_modules/@docusaurus/core/lib/client/exports/ErrorBoundary.js:14:246)
    at App (webpack-internal:///./node_modules/@docusaurus/core/lib/client/App.js:26:241)
    at Router (webpack-internal:///./node_modules/react-router/esm/react-router.js:266:30)
    at BrowserRouter (webpack-internal:///./node_modules/react-router-dom/esm/react-router-dom.js:57:35)
    at r (webpack-internal:///./node_modules/react-helmet-async/lib/index.module.js:16:7320)

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.

Metadata

Typesense Version:

"@docusaurus/core": "2.3.1",
"@docusaurus/preset-classic": "^2.3.1",
"docusaurus-theme-search-typesense": "^0.9.0",

OS: Windows 11

Any idea what might be going wrong here?

Update for Docusaurus ~2.3.0~ 2.3.1

The current version of the plugin (V0.8.0) will not install due to dependency conflicts.

[master_ncfgzwhuqm]:docs$ npm install docusaurus-theme-search-typesense@next --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR!   @docusaurus/core@"2.3.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @docusaurus/core@"2.2.0" from [email protected]
npm ERR! node_modules/docusaurus-theme-search-typesense
npm ERR!   docusaurus-theme-search-typesense@"0.8.0-0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/master/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/master/.npm/_logs/2023-01-28T20_49_31_015Z-debug-0.log

Unable to locate the repository for typesense-docsearch-react

Description

I would like to create some PRs to fix some bugs in typesense-docsearch-react. Unfortunately, I can't find the repository associated to this package. In its package.json, the repository indicated is typesense/typesense-js.

I noticed that docusaurus-theme-search-typesense is the only package that depends on typesense-docsearch-react. So I thought you would be able to tell me where to find the sources of this project to contribute.

Support for Docusaurus 3.1.1

Description

Add support for Docusaurus 3.1.1.

Steps to reproduce

Update to the following dependency versions in package.json:

@docusaurus/core: 3.1.1
@docusaurus/module-type-aliases: 3.1.1
@docusaurus/preset-classic: 3.1.1
@docusaurus/theme-live-codeblock: ^3.1.1
@docusaurus/theme-mermaid: ^3.1.1
@docusaurus/types: 3.1.1
@mdx-js/react: ^3.0.1

Expected Behavior

npm install completes without issue.

Actual Behavior

npm install fails with:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR!   @docusaurus/core@"3.1.1" from the root project
npm ERR!   @docusaurus/core@"3.1.1" from @docusaurus/[email protected]
npm ERR!   node_modules/@docusaurus/plugin-debug
npm ERR!     @docusaurus/plugin-debug@"3.1.1" from @docusaurus/[email protected]
npm ERR!     node_modules/@docusaurus/preset-classic
npm ERR!       @docusaurus/preset-classic@"3.1.1" from the root project
npm ERR!   24 more (@docusaurus/plugin-google-analytics, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @docusaurus/core@"3.1.0" from [email protected]
npm ERR! node_modules/docusaurus-theme-search-typesense
npm ERR!   docusaurus-theme-search-typesense@"^0.15.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR!   peer @docusaurus/core@"3.1.0" from [email protected]
npm ERR!   node_modules/docusaurus-theme-search-typesense
npm ERR!     docusaurus-theme-search-typesense@"^0.15.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Metadata

Typesense Version: 0.25.1

OS: Ubuntu 22.04.3 LTS

No user based analytics parameter in plugin

Description

I am using typesense for my docusaurus plugin. I have my own server running on ec2 instance.
I an getting popular search queries and nohits queries analytics for the searched queries.
But there is not any option that I can get user based analytics for the same.
There must be any solution to get user based analytics for the given conditions.

Steps to reproduce

Expected Behavior

Actual Behavior

Metadata

Typesense Version:

OS:

Page crashed: regeneratorRuntime is not defined

Description

I'm using typesense in my docusaurus docs. I couldn't figure out why this error happened, but my search bar is not working and I have this error:
image

Any ideas about the problem and how to fix that?

Dependency issue with Docusaurus 2.0.1

When running:
npm install docusaurus-theme-search-typesense@next --save

The result is:

ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/core
npm ERR! @docusaurus/core@"2.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @docusaurus/core@"2.0.0-rc.1" from [email protected]
npm ERR! node_modules/docusaurus-theme-search-typesense
npm ERR! docusaurus-theme-search-typesense@"0.5.3-0" from the root project

Is this not compatible with the latest docusaurus 2.0.1?

Metadata

Issues on search page after clicking on "see all results" from modal

Description

Hi,
I am working on Polygon Edge project. We are using your library for adding doc search on our documentation website. We have discovered 2 small bugs.

When we use modal for search, everything works great! We have also tested transparent background for the logo in a dark mode which you have introduced in 0.3.0-1 version. Thank you so much for that!
Screen Shot 2022-01-17 at 12 23 23 PM (2)

Then the user clicks on See all xxx results at the bottom of the modal, the search page is opened.
Screen Shot 2022-01-17 at 12 26 18 PM (2)

Here we are getting an error when we are searching
{"results":[{"code":404,"error":"Could not find a filter field named docusaurus_tagin the schema."},{"code":404,"error":"Could not find a filter field nameddocusaurus_tagin the schema."},{"code":404,"error":"Could not find a facet field nameddocusaurus_tag in the schema."}]}

And also on this page your logo is not transparent in the dark mode (small cosmetic improvement).

Typsense Version:
In production we are currently using ^0.2.0 and today we are going to switch to 0.3.0-1

i18n not working correctly

Description

After installing docusaurus-theme-search-typesense 0.15.0-0 in docusaurus and setting i18n in docusaurus.config.js to "defaultLocale: 'zh-Hans', locales: ['zh-Hans ']" in docusaurus.config.js, the search box functions normally after publishing, but the search box UI still shows English.

If you add algolia node to the themeConfig (keep the typesense node), the search box UI can display the localized language normally, and the search is also using the typesense.

Expected Behavior

Following the locale configuration, the search box UI shows the corresponding language
For example, "Search docs" is displayed as "Search" in Chinese.

image

Actual Behavior

image

Metadata

Typesense Version:0.25.2
docusaurus-theme-search-typesense: 0.15.0-0
OS:Ubuntu 22

Search-box is not in line with other items under medium screen (within 996px)

Description

Under medium screen (within 996px), search-box is not in line with the other items.

Expected Behavior

search-box is in line with the other items under medium screen (within 996px)

Actual Behavior

when I unchecked the "position:absolute",it looks good.

Metadata

docusaurus-theme-search-typesense:v0.4.0
docusaurus: 2.0.0-beta.21
OS: Win11/Edge

image
image
image

filter_by parameter not working

Description

Hello,
filter_by parameter not working on my docusaurus site.

I want to ignore anchor:shorcut-product on search result(See all result page). Even if I set the parameters, the result is the same.

config is follwing:

typesenseSearchParameters: {
  filter_by: 'anchor:!=shortcut-product',
  highlight_affix_num_tokens: 200,
},

refer to the following dataset:

{
  "anchor": "shortcut-product",
  "docusaurus_tag": "docs-default-current",
  "hierarchy": {
    "lvl0": "...",
    "lvl1": "WhaTap Docs",
    "lvl2": null,
    "lvl3": "상품별 문서 바로가기 ​",
    "lvl4": null,
    "lvl5": null,
    "lvl6": null
  },
  "hierarchy.lvl0": "...",
  "hierarchy.lvl1": "WhaTap Docs",
  "hierarchy.lvl3": "상품별 문서 바로가기 ​",
  "hierarchy_camel": [
    {
      "lvl0": "...",
      "lvl1": "WhaTap Docs",
      "lvl2": null,
      "lvl3": "상품별 문서 바로가기 ​",
      "lvl4": null,
      "lvl5": null,
      "lvl6": null
    }
  ],
  "hierarchy_radio": {
    "lvl0": null,
    "lvl1": null,
    "lvl2": null,
    "lvl3": "상품별 문서 바로가기 ​",
    "lvl4": null,
    "lvl5": null,
    "lvl6": null
  },
  "hierarchy_radio_camel": {
    "lvl0": null,
    "lvl1": null,
    "lvl2": null,
    "lvl3": "상품별 문서 바로가기 ​",
    "lvl4": null,
    "lvl5": null,
    "lvl6": null
  },
  "id": "136246",
  "item_priority": 70025,
  "language": "ko",
  "no_variables": true,
  "objectID": "29e9199a93710554195c18c44521599498eddf08",
  "tags": [],
  "type": "lvl3",
  "url": "https://docs.whatap.io/ja/Support-env#shortcut-product",
  "url_without_anchor": "https://docs.whatap.io/ja/Support-env",
  "url_without_variables": "https://docs.whatap.io/ja/Support-env#shortcut-product",
  "version": [
    "current"
  ],
  "weight": {
    "level": 70,
    "page_rank": 0,
    "position": 5,
    "position_descending": 25
  }
}

and url is not exist, why is such a value generated?

Typesense Version: 2.4.1

OS: linux

Take into account url query params (url.search) into results

Description

Query params are not used when SearchBar and SearchPage adapt the url from Typesense server response to docusaurus component.

Steps to reproduce

Scrap a website with some url with query params
Do a search in docusaurus
Check that response from typesense server return the query param in the response
Inspect the docusaurus href link and verify that link skips query params.

Expected Behavior

The href field has to take into account the query params

Actual Behavior

The actual code only has into account pathname and hash.

docusaurus-theme-search-typesense/src/theme/SearchPage/index.tsx line 284 concat parsedURL.search:

            url: isRegexpStringMatch(externalUrlRegex, parsedURL.href)
              ? parsedURL.href
              : parsedURL.pathname + parsedURL.search +  parsedURL.hash,

In the same way, we had to do the same modification into docusaurus-theme-search-typesense/src/theme/SearchBar/index.tsx at line 193:

url: withBaseUrl(`${url.pathname}${url.search}${url.hash}`),

useSearchQuery can't be resolved

Description

Module not found: Error: Can't resolve '@theme/hooks/useSearchQuery' in './node_modules/docusaurus-theme-search-typesense/src/theme/SearchPage'

Steps to reproduce

  1. Install this package into a docusurus project yarn add docusaurus-theme-search-typesense
  2. Add below config to docusaurus.config.js
{
  themes: ['docusaurus-theme-search-typesense'],
  themeConfig: {
    typesense: {
      typesenseCollectionName: 'docs',
      typesenseServerConfig: {
        nodes: [
          {
            host: '127.0.0.1',
            port: 9090,
            protocol: 'http',
          },
        ],
        apiKey: '< key >',
      },
      typesenseSearchParameters: {},
      // Optional
      contextualSearch: true,
    },
  },
}

Expected Behavior

Show search bar in generated docs website

Actual Behavior

image

Metadata

Typsense Version:
0.21.0

OS:
Ubuntu 20.04.3

Fix compatibility issue with Docusaurus v2.0.0-beta.22 and above

Description

Building a project based on Docusaurus v2.0.0-beta.22 and later crashes.

Steps to reproduce

  1. Create a new project based on Docusaurus v2.0.0-beta.22 or later (the latest version at the time of writing being v2.0.0-rc.1).
  2. Integrate the Typesense plugin according to this guideline.
  3. Run npm run build.

Expected Behavior

The project builds successfully.

Actual Behavior

The build fails with the following error:

TypeError: (0 , lib_namespaceObject.useTitleFormatter) is not a function

[WARNING] node_modules/docusaurus-theme-search-typesense/src/theme/SearchPage/index.js:
export 'useTitleFormatter' (imported as 'useTitleFormatter') was not found in '@docusaurus/theme-common'

Proposed solution

As per this pull request, some exports were moved to internal.ts.

So the import in src/theme/SearchPage/index.js needs to be changed from:

import {useTitleFormatter, usePluralForm} from '@docusaurus/theme-common';

to

import {useTitleFormatter, usePluralForm} from '@docusaurus/theme-common/internal';

It would be awesome if you could fix the compatibility issue and also update the dependencies so that the plugin is compatible with Docusaurus v2.0.0-rc.1.

Metadata

Typsense Version: 0.4.0

OS: Windows 11 (22000.795)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.