Skip to content Docs index for AI agents (llms.txt)
LaRecipe
2.x

Versions

FeaturesSearch Functionality

Search Functionality

It's very handy to have a search function available so that your users can find their needs quickly.

Updated 2 min read

Overview

LaRecipe supports two different search engines: algolia, internal. The internal engine can be very useful if you have a private documentation since algolia DocSearch is free only for open-source projects.

However, the internal engine has limited power compared to algolia since it only indexes the titles of the pages and their headings.

You can enable search functionality simply by activating the enabled option inside the config/larecipe.php file.

Once activated, the search button will appear at the top-right of the navbar. Also, you can trigger the search panel by typing s 😼

php
return [
    'search'            => [
        'enabled'       => false,
        ...
    ]
];

Available Engines

You can choose the internal search engine by assigning the default option to internal. You can also configure the indexable nodes so they will appear in the search results.

php
return [
    'search'            => [
        'enabled'       => true,
        'default'       => 'internal',
        'engines'       => [
            'internal'  => [
                'index' => ['h2', 'h3']
            ],
            ...
        ]
    ]
]

Algolia DocSearch requires you to submit your site to them for indexing before it starts working.

For more information, refer to Algolia DocSearch's documentation

php
return [
    'search'            => [
        'enabled'       => true,
        'default'       => 'algolia',
        'engines'       => [
            ...
            'algolia'   => [
                'key'   => 'your_algolia_key',
                'index' => 'your_algolia_index'
            ]
        ]
    ]
];

Newsletter

Stay in the loop

LaRecipe release notes by email. Unsubscribe any time.