Skip to content
Skillpedia
General coding33k · #8723

algolia-search

What it does

This skill gives your AI agent patterns for building fast search with Algolia. It is for developers adding search to a website or app.

When to use it

  • ✓When you want to add instant search to a React or Next.js site.
  • ✓When you need to keep an Algolia search index in sync with your data.
  • ✓When search results are not relevant and you want to tune them.

Skill link

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/algolia-search/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/algolia-search/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Add Algolia instant search to my Next.js store with filters for brand and price.”

5 new skills a week. 1 minute to read.

How it works

The skill gives the agent guidance on InstantSearch hooks, server-side rendering and indexing strategies. The agent applies these to your project and watches for common pitfalls.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Algolia Search Integration

Patterns

React InstantSearch with Hooks

Modern React InstantSearch setup using hooks for type-ahead search.

Uses react-instantsearch-hooks-web package with algoliasearch client. Widgets are components that can be customized with classnames.

Key hooks:

  • useSearchBox: Search input handling
  • useHits: Access search results
  • useRefinementList: Facet filtering
  • usePagination: Result pagination
  • useInstantSearch: Full state access

Next.js Server-Side Rendering

SSR integration for Next.js with react-instantsearch-nextjs package.

Use <InstantSearchNext> instead of <InstantSearch> for SSR. Supports both Pages Router and App Router (experimental).

Key considerations:

  • Set dynamic = 'force-dynamic' for fresh results
  • Handle URL synchronization with routing prop
  • Use getServerState for initial state

Data Synchronization and Indexing

Indexing strategies for keeping Algolia in sync with your data.

Three main approaches:

  1. Full Reindexing - Replace entire index (expensive)
  2. Full Record Updates - Replace individual records
  3. Partial Updates - Update specific attributes only

Best practices:

  • Batch records (ideal: 10MB, 1K-10K records per batch)
  • Use incremental updates when possible
  • partialUpdateObjects for attribute-only changes
  • Avoid deleteBy (computationally expensive)

⚠️ Sharp Edges

Issue Severity Solution
Issue critical See docs
Issue high See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs
FAQ

Which packages does it use?

It uses react-instantsearch packages with the algoliasearch client for React and Next.js.

How should I update my index?

It recommends incremental or partial updates when possible, and batching records in groups of about 1,000 to 10,000.

Why avoid deleteBy?

The skill says deleteBy is computationally expensive, so it should be avoided where possible.

Details

Original description by the author

Expert patterns for Algolia search implementation, indexing strategies, React InstantSearch, and relevance tuning Use when: adding search to, algolia, instantsearch, search api, search functionality.

repo: davila7/claude-code-templates

Popularity

GitHub stars
33k
Ranking position
#8723
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills