Skip to content

Commit 5ff2a39

Browse files
committed
Update examples
1 parent faf7fbd commit 5ff2a39

6 files changed

Lines changed: 69 additions & 27 deletions

File tree

examples/demo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"start": "parcel index.html"
1010
},
1111
"dependencies": {
12-
"@docsearch/css": "3.3.3",
13-
"@docsearch/react": "3.3.3",
12+
"typesense-docsearch-css": "^0.4.0",
13+
"typesense-docsearch-react": "^3.4.0-1",
1414
"react": "^18.1.0",
1515
"react-dom": "^18.1.0"
1616
},

examples/demo/src/App.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
11
import React from 'react';
2-
import { DocSearch } from '@docsearch/react';
2+
import { DocSearch } from 'typesense-docsearch-react';
33

44
import './app.css';
55
import '@docsearch/css';
66

77
function App() {
8+
const params = {
9+
typesenseCollectionName: 'docusaurus-2', // Replace with your own doc site's name. Should match the collection name in the scraper settings.
10+
11+
typesenseServerConfig: {
12+
nodes: [
13+
{
14+
host: 'x3s805zrawjuod9fp-1.a1.typesense.net',
15+
port: 443,
16+
protocol: 'https',
17+
},
18+
{
19+
host: 'x3s805zrawjuod9fp-2.a1.typesense.net',
20+
port: 443,
21+
protocol: 'https',
22+
},
23+
],
24+
apiKey: 'c1DmVFTQGnnP5XtW8FV7btCDeTYhBLz6', //insert search key here
25+
},
26+
typesenseSearchParameters: {}
27+
}
828
return (
929
<div>
1030
<h1>DocSearch v3 - React</h1>
1131
<DocSearch
12-
indexName="docsearch"
13-
appId="R2IYF7ETH7"
14-
apiKey="599cec31baffa4868cae4e79f180729b"
32+
{...params}
1533
/>
1634
</div>
1735
);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang='en'>
3+
<head>
4+
<meta charset='UTF-8'>
5+
<title>Title</title>
6+
<!-- Before the closing head -->
7+
<link
8+
rel='stylesheet'
9+
href='https://cdn.jsdelivr.net/npm/typesense-docsearch-css@0.4.0'
10+
/>
11+
</head>
12+
<body>
13+
<div id='docsearch'></div>
14+
<!-- Before the closing body -->
15+
<script src='https://cdn.jsdelivr.net/npm/typesense-docsearch.js@3.4.0-7'></script>
16+
<script>
17+
window.onload = function() {
18+
docsearch({
19+
container: '#docsearch',
20+
typesenseCollectionName: 'docusaurus-2', // Replace with your own doc site's name. Should match the collection name in the scraper settings.
21+
22+
typesenseServerConfig: {
23+
nodes: [
24+
{
25+
host: 'x3s805zrawjuod9fp-1.a1.typesense.net',
26+
port: 443,
27+
protocol: 'https',
28+
},
29+
{
30+
host: 'x3s805zrawjuod9fp-2.a1.typesense.net',
31+
port: 443,
32+
protocol: 'https',
33+
},
34+
],
35+
apiKey: 'c1DmVFTQGnnP5XtW8FV7btCDeTYhBLz6', //insert search key here
36+
},
37+
typesenseSearchParameters: {},
38+
});
39+
}
40+
</script>
41+
42+
</body>
43+
</html>

examples/js-demo/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// import docsearch from '@docsearch/js/dist/umd';
2-
import docsearch from 'typesense-docsearch.js';
2+
import docsearch from 'typesense-docsearch.js/dist/umd';
33

44
import './app.css';
55

examples/js-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"start": "parcel index.html"
1010
},
1111
"dependencies": {
12-
"typesense-docsearch.js": "^3.3.3",
12+
"typesense-docsearch.js": "^3.4.0-1",
1313
"typesense-docsearch-css": "^0.4.0"
1414
},
1515
"devDependencies": {

yarn.lock

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20593,25 +20593,6 @@ typescript@4.7.4:
2059320593
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
2059420594
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
2059520595

20596-
typesense-docsearch-react@^0.3.0:
20597-
version "0.3.0"
20598-
resolved "https://registry.yarnpkg.com/typesense-docsearch-react/-/typesense-docsearch-react-0.3.0.tgz#da8f160096218e76bedd2a073960c080dab1a81e"
20599-
integrity sha512-K2mO0KDUQIXlwPyybuEX+l39MLMA8fsReai/+UukXiJ3iOlT0LfEbH5IX7gb+FgxdGyNyB+DgTuEHEcy5Mi1gQ==
20600-
dependencies:
20601-
"@algolia/autocomplete-core" "1.8.2"
20602-
"@algolia/autocomplete-preset-algolia" "1.8.2"
20603-
typesense "^1.4.0-3"
20604-
typesense-docsearch-css "^0.4.0"
20605-
typesense-instantsearch-adapter "^2.4.2-1"
20606-
20607-
typesense-docsearch.js@^3.3.3:
20608-
version "3.3.3"
20609-
resolved "https://registry.yarnpkg.com/typesense-docsearch.js/-/typesense-docsearch.js-3.3.3.tgz#596cb72da705bc0c038684065d69fdfb158ad819"
20610-
integrity sha512-hkCkcbGmJupYchkcHsS5iMBtT4ThWv+D3L5cLMinpiqdgUEvhNtYnR6zutl9BjBnIb4tmcdI23adiL8V8ioBuQ==
20611-
dependencies:
20612-
preact "^10.0.0"
20613-
typesense-docsearch-react "^0.3.0"
20614-
2061520596
typesense-instantsearch-adapter@^2.4.2-1:
2061620597
version "2.4.2-1"
2061720598
resolved "https://registry.yarnpkg.com/typesense-instantsearch-adapter/-/typesense-instantsearch-adapter-2.4.2-1.tgz#922aa2c84fbe027a15bb357db9378687c04ca855"

0 commit comments

Comments
 (0)