Giter Club home page Giter Club logo

Comments (7)

RogalaPiotr avatar RogalaPiotr commented on June 23, 2024 2

How to do that?
I'm trying by those commands without effects:

  • npm run build
  • yarn run build

Unfortunately, my search bar is saying: ⚠️ The search index is only available when you run docusaurus build!

from docusaurus-search-local.

IdiosApps avatar IdiosApps commented on June 23, 2024 1
  • yarn build to build the static site
  • yarn run serve to serve the static site
    I have the searchbar working locally with this.

from docusaurus-search-local.

weareoutman avatar weareoutman commented on June 23, 2024

Currently, yes, it requires build.

from docusaurus-search-local.

RogalaPiotr avatar RogalaPiotr commented on June 23, 2024

OK, I found a solution.

docusaurus-search-local is a fork of docusaurus-search-local there we can find info: "Search does not work in development (i.e., when running yarn start)." >> https://github.com/cmfcmf/docusaurus-search-local

So, if you want run a search, you can:

  1. npm run build
  • after this command you should have new folder "build" in your app
  1. rebiuld your app with "RUN_MODE=production" - this is necessary to run search properly.

In my example, I am using docusaurus app on image: awesometic/docusaurus. The proper setup to re-run container is like this:

docker run -d --name=docusaurus
-p 80:80
-v /config/dir:/docusaurus
-e TARGET_UID=1000
-e TARGET_GID=1000
-e AUTO_UPDATE=true
-e WEBSITE_NAME="awesometic-docs"
-e TEMPLATE=classic
-e RUN_MODE=production
awesometic/docusaurus

I hope this could help someone in the future.

from docusaurus-search-local.

TysonMN avatar TysonMN commented on June 23, 2024

I'm trying by those commands without effects:

  • npm run build
  • yarn run build

The command you were looking for is yarn build.

from docusaurus-search-local.

SebastianSchuetze avatar SebastianSchuetze commented on June 23, 2024

@Anthony-Gaudino all local search plugins needs to be build.

The sites need to be scanned first and an index being build. This is a given no matter what type of search you have. The only difference between local and online search engines is, that they do this asynchronously. But usually results are not available immediately.

from docusaurus-search-local.

KdB13 avatar KdB13 commented on June 23, 2024

In my case the search is showing no results. I followed the steps below:

  1. DEBUG=search-local:* npm run build
  2. npm run serve

Now, the search bar is also visible and the search-index.json file is also generated within the build folder but when I type something it always shows No results.

The DEBUG logs are also not showing any errors.

from docusaurus-search-local.

Related Issues (20)

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.