本文へスキップ
Skillpedia
一般的なプログラミング33k · #8723

algolia-search

できること

このスキルにより、AIは高速な検索をAlgoliaで作るためのパターンを使えます。Webサイトやアプリに検索を追加する開発者向けです。

使う場面

  • ✓ReactまたはNext.jsのサイトに即時検索を追加したいとき。
  • ✓Algoliaの検索インデックスを、データと同期させ続ける必要があるとき。
  • ✓検索結果が適切でなく、結果を調整したいとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/algolia-search/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ブランドと価格で絞り込めるように、Next.jsのストアにAlgoliaの即時検索を追加してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、InstantSearchのフックや、サーバーサイドレンダリング、インデックス作成の方法についての指針をエージェントに与えます。エージェントはそれをプロジェクトに適用し、よくある落とし穴に注意します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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
よくある質問

どのパッケージを使いますか?

ReactとNext.js向けのalgoliasearchクライアントと、react-instantsearchパッケージを使います。

インデックスはどのように更新すべきですか?

可能な場合は増分更新または部分更新を勧め、レコードは約1,000〜10,000件のまとまりで処理するよう勧めています。

deleteByを避けるのはなぜですか?

このスキルは、deleteByは計算コストが高いため、可能な限り避けるべきだとしています。

詳細

作者による元の説明

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

人気

GitHubのスター
33k
ランキング
#8723
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル