Skip to content

Commit 59d7ba8

Browse files
committed
Add filtering instructions
1 parent e3b429b commit 59d7ba8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,22 @@ client.removeCustomFieldFilter('city','paris');
169169
client.removeCustomFieldFilter('city');
170170
```
171171

172+
#### Set filtering object
173+
Set complex filtering object that can contain nested *and*, *or*, *not*, and *range* filters.
174+
175+
```js
176+
// Find results where brand is apple, color is not white, and price is between 200 and 500
177+
var filter = {
178+
'and':[
179+
{'custom_fields.brand': 'apple'},
180+
{'not': {'custom_fields.color': 'white'}},
181+
{'range': {'custom_fields.price': {'gt': 200, 'lt':500}}}
182+
]
183+
};
184+
185+
client.setFilterObject(filter);
186+
```
187+
172188
#### Manage paging
173189
Set page number, page size and sorting parameters. It's possible to order results by:
174190
- relevance (descending)

0 commit comments

Comments
 (0)