This is the React InstantSearch v7 documentation.
If you’re upgrading from v6, see the upgrade guide.
If you were using React InstantSearch Hooks,
this v7 documentation applies—just check for necessary changes.
To continue using v6, you can find the archived documentation.
How OpenSearch works
In your website or web application, you include a link to an OpenSearch description document. In this document, you describe how browsers can interact with an underlying search engine. This interaction is based on URL templates, for example,https://mysite.com?q={searchTerms}
,
which tell browsers how to make search requests.
Since the interaction between the browser and search engine is based on a URL,
you need to enable URL synchronization.
Create an OpenSearch description document
The OpenSearch description document is an XML file following the OpenSearch specification. For example:XML
ShortName
is the name of your app or website search. It must be 16 or fewer characters.Description
is a human readable description of your search engine. It must be 1024 or fewer characters.Url
has thetemplate
attribute, that browsers use to create the URL to your search engine.Image
has a URL (linkToImage) to a PNG image that represents your website, for example, the favicon.
The XML document must be served with
Content-Type: application/opensearchdescription+xml
media type.Include the OpenSearch description document in your website
You can reference the XML document in thehead
of your web pages:
HTML