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
Performs a reverse search on a percolate index. [[More info on percolate indexes in Manticore Search Manual]](https://manual.manticoresearch.com/Creating_a_table/Local_tables/Percolate_table#Percolate-table)
115
113
116
-
Performs a percolate search.
117
114
This method must be used only on percolate indexes.
118
115
119
-
Expects two parameters: the index name and an object with an array of documents to search with.
120
-
Here is an example of the document object:
116
+
Expects two parameters: the index name and an object with a document or an array of documents to search by.
117
+
Here is an example of the object with a single document:
118
+
121
119
```
122
120
{
123
121
"query":
@@ -126,7 +124,7 @@ Here is an example of the document object:
126
124
{
127
125
"document":
128
126
{
129
-
"title":"sample content"
127
+
"content":"sample content"
130
128
}
131
129
}
132
130
}
@@ -163,16 +161,37 @@ Responds with an object with matched stored queries:
163
161
}
164
162
```
165
163
164
+
And here is an example of the object with multiple documents:
165
+
166
+
```
167
+
{
168
+
"query":
169
+
{
170
+
"percolate":
171
+
{
172
+
"documents": [
173
+
{
174
+
"content":"sample content"
175
+
},
176
+
{
177
+
"content":"another sample content"
178
+
}
179
+
]
180
+
}
181
+
}
182
+
}
183
+
```
184
+
166
185
167
186
### Example
168
187
169
188
```javascript
170
189
var Manticoresearch =require('manticoresearch');
171
190
172
191
var searchApi =newManticoresearch.SearchApi();
173
-
asyncfunction() {
192
+
(asyncfunctionpercolateExample() {
174
193
res =awaitsearchApi.percolate('products',{"query":{"percolate":{"document":{"title":"What a nice bag"}}}});
0 commit comments