---
title: "SearchとRecommendation APIを使った検索体験の作成"
slug: "using-the-search-and-recommendation-api-to-create-search-experiences"
abstract: "Searchの簡単な紹介とSitecore Searchの勧告API。"
---
# SearchとRecommendation APIを使った検索体験の作成

Search and Recommendation APIを使って、訪問者に最高の検索体験を提供します。このAPIは1つのエンドポイントと、[検索結果](https://doc.sitecore.com/search/ja/developers/search-developer-guide/integrating-using-rest-apis/using-the-search-and-recommendation-api-to-create-search-experiences/querying-without-a-keyphrase.html "Querying without a keyphrase")、[recommendations](https://doc.sitecore.com/search/ja/developers/search-developer-guide/integrating-using-rest-apis/using-the-search-and-recommendation-api-to-create-search-experiences/getting-basic-recommendations.html "Getting basic recommendations")、[AI搭載の質問や回答](https://doc.sitecore.com/search/ja/developers/search-developer-guide/integrating-using-rest-apis/using-the-search-and-recommendation-api-to-create-search-experiences/getting-ai-powered-questions-and-answers.html "Getting AI-powered questions and answers")などを得るために使える多くのオブジェクトやキーを持っています。

オブジェクトやキーの説明、データモデルの詳細なビューについては、[Search and Recommendation APIのリファレン](http://doc.sitecore.com/search/en/developers/search-and-recommentation-api/index.html) スを参照してください。

管理者がSitecore Searchを使って[ソース](https://doc.sitecore.com/search/en/users/search-user-guide/index-items.html)の[初期設定](https://doc.sitecore.com/search/en/users/search-user-guide/get-started.html)と設定を行った後、Searchと推奨のAPIを使ってウェブサイトやモバイルアプリと統合できます。

## Sitecore SearchとSearchおよび勧告API

Sitecore SearchとSearchおよび勧告API連携して機能します。管理者はSitecore Searchを主に2つの目的で行います。

-   初期設定を行います。つまり、ソース、ウィジェット、ページ、属性、ソート、フィルタリング、テキスト関連性などのオプションを設定し、使いたい機能です。これらは必ず実行しなければAPI呼び出しができません。
-   実行時に変更されない設定を設定しましょう。例えば、 [APIコールですべてのfacets](https://doc.sitecore.com/search/ja/developers/search-developer-guide/integrating-using-rest-apis/using-the-search-and-recommendation-api-to-create-search-experiences/using-faceted-search.html#UUID-1bab7dc1-558b-93c5-43ce-4a4c264b49a8_section-idm4654583551281633326426223705 "Get all available facets")を要求した際にSitecore Search返してほしいfacetsを設定できます。これは、すべてのfacetsをリクエストする際に、どのfacetsを表示するかをランタイムのビジタークエリに依存しないためです。

実行時にしかパスできないアイテムをリクエストし設定するには、Searchと推奨APIを使用します。例えば、フィルターレベルでfacetsを取得したい、コンテキストを送信したい場合user 、APIを通じて行う必要があります。これは、利用可能なfacetsがビジタークエリに依存し、特定のビジターの行動がAPIコールをトリガーしたときに初めてコンテキストuser分かるためです。

> !注SearchでできることとAPIを通じてできることには重複があります。もし競合がある場合、API経由で要求する設定は必ずSearchで定義したものを上書きします。