You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 20, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+99Lines changed: 99 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,105 @@ php please meili-search:documents help
60
60
php please meili-search:documents update
61
61
```
62
62
63
+
## Searching
64
+
Searching is best done with JavaScript talking to MeiliSearch directly. This will give you the most peformant real time searches. Here is a simple example of how you could do this with [AlpineJS](https://github.com/alpinejs/alpine) and [TailwindCCS](https://tailwindcss.com).
65
+
66
+
***Note:** These steps assume you already have AlpineJS and Tailwind CCS already set up and working in your project.*
67
+
68
+
### Install the MeiliSearch NPM module
69
+
```bash
70
+
npm install meilisearch
71
+
```
72
+
or
73
+
```bash
74
+
yarn add meilisearch
75
+
```
76
+
77
+
### Import and set up MeiliSearch
78
+
```js
79
+
importMeiliSearchfrom'meilisearch';
80
+
81
+
window.client=newMeiliSearch({
82
+
host:'http(s)://Your MeiliSearch address & port',
83
+
apiKey:'Your MeiliSearch PUBLIC Key',
84
+
});
85
+
```
86
+
87
+
### Customize your Search Component
88
+
Here is a basic autocomplete using AlpineJS and Tailwind CCS, feel free copy it, customize it, or just use it as insperation to do something completly diffrent.
89
+
```html
90
+
<div
91
+
x-data="{
92
+
searchString: '',
93
+
results: {
94
+
hits: [],
95
+
},
96
+
index: window.client.getIndex('Your Index UID Goes Here'),
Please see the [Release Notes](https://statamic.com/addons/jrc9designstudio/meili-search/release-notes) for more information what has changed recently.
0 commit comments