Giter Site home page Giter Site logo

Comments (6)

erez-o avatar erez-o commented on August 20, 2024

Hi,

I think you need to apply as an open source project first at https://docsearch.algolia.com/

Regarding integration in docsforge, I did some testing and the following method worked for me.

I followed the guideline at https://docsearch.algolia.com/docs/dropdown

You can add custom JS and CSS into docsforge, by editing project settings (cog icon, https://anyfig.docsforge.com/admin/edit-project-settings/)

Add the following CSS:

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn/docsearch.min.css"
/>

Add the following JS: (I tried algolia example test project)

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn/docsearch.min.js"></script>
<script>
  docsearch({
    apiKey: '25626fae796133dc1e734c6bcaaeac3c',
    indexName: 'docsearch',
    inputSelector: '#search-in-project',
    debug: false,
  });
</script>

I have however no experience with optimizing algolia's search output (crawler + scraper), so let me know how well it works.

from docsforge.

erez-o avatar erez-o commented on August 20, 2024

I can see at https://anyfig.docsforge.com/ that the old search is still visible. I'll have an option to disable it on my next release.

I do see however that algolia search results link to pages in https://anyfig.now.sh/ website. Can that be changed?

from docsforge.

OlofHarrysson avatar OlofHarrysson commented on August 20, 2024

Hi, thanks for helping out! I tried the method that you suggested and it seems to be working, but as you said - the links go to the old website. Algolia fixes this manually by configuring their crawler https://github.com/algolia/docsearch-configs/blob/master/configs/anyfig.json.

That configuration file should also contain options to get the search functionality working well/optimized. I'm still waiting for Algolia to get back to me. Once they do and we've made the necessary changes I'll write here again :)

I'll have an option to disable it on my next release.

Great!

from docsforge.

erez-o avatar erez-o commented on August 20, 2024

Fixed, you can now disable the default search in your project settings. I've added a short help section in https://help.docsforge.com/master/search-engines/ .

Tell me if their crawler behaves well, and if it doesn't, maybe I can help. Leaving issue open for now.

from docsforge.

OlofHarrysson avatar OlofHarrysson commented on August 20, 2024

Works great! Unfortunately, Algolia hasn't replied to my emails about reconfiguring the crawler. I'm not sure why but I want to believe that they're just overloaded. I'm not in a rush so it's ok.

I'll ping you if I run into problems with the crawler, thanks for offering :)

from docsforge.

OlofHarrysson avatar OlofHarrysson commented on August 20, 2024

Hello, I've managed to add the Algolia search for the docsforge website with the help from Algolia. We changed the config in their gir repo. This new config supports both the old anyfig-website as well as the new docsforge one.

It seems to be working well, I can search for text in the tutorial as well as the API. I'm quite happy with the result - just want to flag that it won't support multiple versions the way it's set up now. Algolia can crawl different versions and it's up to the user to separate the versions/tags they want to show to the user. This is described in their docs

I changed the inserted javascript on the docsforge website to include the facetFilters

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn/docsearch.min.js"></script>
<script>
  docsearch({
    apiKey: 'real-api-key',
    indexName: 'anyfig',
    inputSelector: '#search-in-project',
    debug: false,
    algoliaOptions: {
        'facetFilters': ["tags:docsforge", "version:master"]
    },
  });
</script>

This makes it so that I only get results for the tags:docsforge and version:master. If one needs to support search for more versions, the master version can't be hardcoded. I suppose inserting different javascript on different versions of the website would solve this but I'm OK with just one version at the moment :)

I'm closing the issue, thanks for the help

from docsforge.

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.