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
Copy file name to clipboardExpand all lines: docs/add-ons/pro-search/filters.md
+23-16Lines changed: 23 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ For instance, if a search form contains a `keywords` field, the [Keywords filter
16
16
17
17
## Keywords Filter
18
18
19
-
The Keywords filter lets you filter entries by search terms (ie. keywords) and calculates a relevance score to each item in the search results.
19
+
The Keywords filter lets you filter entries by search terms (ie. keywords) and calculates a relevance score for each item in the search results.
20
20
21
21
NOTE: **Note:** You need to create at least one [Collection](add-ons/pro-search/collections.md) to use with the Keywords filter. (You don't need to create a collection to use the other types of filters, just when using Keywords.)
22
22
@@ -177,7 +177,7 @@ NOTE: **Note:** When enabled, inflections and stems are only applied to keyword
177
177
178
178
## Categories
179
179
180
-
You can use the native `category` parameter to filter by category. For more advanced filtering by category, you can also divide categories into groups. The group syntax lets you combine AND and OR filtering (category 1 or 2 and category 3 or 4), as parameters are always combined with AND.
180
+
Use the native `category` parameter to filter by category. For more advanced filtering by category, you can also divide categories into groups. The group syntax lets you combine AND and OR filtering (category 1 or 2 and category 3 or 4), as parameters are always combined with AND.
181
181
182
182
### `category`
183
183
@@ -191,27 +191,28 @@ NOTE: **Note:** Use category IDs instead of URL titles for better performance.
191
191
192
192
## Distance
193
193
194
-
You can use the Distance filter to limit results by a given maximum distance. This filter prefers for you to use two channel fields where latitude and longitude values are stored. Alternatively, you can use a single field where the two values are separated by a comma. Using the Distance filter will limit results to entries that actually have latitude and longitude values entered.
194
+
Use the Distance filter to limit results by a given maximum distance. This filter prefers for you to use two channel fields where latitude and longitude values are stored. Alternatively, you can use a single field where the two values are separated by a comma. Using the Distance filter will limit results to entries that actually have latitude and longitude values entered.
195
195
196
196
### Parameters
197
197
198
198
#### `distance:from`
199
199
200
-
Latitude and longitude values separated by a vertical bar, used to calculate the distance.
200
+
The spot you're using to calculate the distance from. Must be latitude and longitude values separated by a vertical bar.
201
201
202
202
distance:from="52.163298|4.505547"
203
203
204
204
#### `distance:to`
205
205
206
-
The one or two channel field names that contain the latitude and longitude values separated by a vertical bar, used to calculate the distance.
206
+
The one or two channel field names that contain the latitude and longitude values you're comparing distance to, separated by a vertical bar if two fields.
207
207
208
+
distance:to="store_geocode"
208
209
distance:to="cf_entry_lat|cf_entry_long"
209
210
210
211
NOTE: **Note:** Use two separate fields instead of a single one for better performance.
211
212
212
213
#### `distance:radius`
213
214
214
-
The maximum distance between the from and to values. Leave blank for no maximum.
215
+
The maximum distance allowable between the from and to values. Leave blank for no maximum.
215
216
216
217
distance:radius="50"
217
218
@@ -223,17 +224,15 @@ The unit for the distances, either km, mi, m or yd. Defaults to km.
223
224
224
225
### Variables
225
226
226
-
The Distance filter makes this variable available in the [Results tag](/add-ons/pro-search/tags.md#exppro_searchresults):
227
-
228
227
#### `{pro_search_distance}`
229
228
230
-
The calculated distance in the given unit for this entry.
229
+
The calculated distance in the given unit for this entry. The Distance filter makes this variable available in the [Results tag](/add-ons/pro-search/tags.md#exppro_searchresults).
231
230
232
-
NOTE: **Note:** Using the Distance filter will return the search results ordered by distance, ignoring keyword relevance if applicable. Override by explicitly setting the orderby parameter.
231
+
NOTE: **Note:** Using the Distance filter will return the search results ordered by distance instead of keyword relevance (if applicable). You can override this by explicitly setting the orderby parameter to `relevance`.
233
232
234
233
## Field Search
235
234
236
-
You can use the native `search:field_name` parameter to target specific fields. Additionally, Pro Searchcan target the entry’s ***title***, ***url_title***, ***status***, target [Grid](/fieldtypes/grid.md) columns, use multiple values for [numeric matching](/channels/entries.md#numeric-matching) (in combination with the `gt`, `gte`, `lt` and `lte` params), and use ***starts / ends with*** matching.
235
+
Use the native `search:field_name` parameter to target specific fields, just like `channel:entry` does already. Additionally, Pro Search's `pro_search:results`can target the entry’s ***title***, ***url_title***, ***status***, and target [Grid](/fieldtypes/grid.md) columns. It can also use multiple values for [numeric matching](/channels/entries.md#numeric-matching) (in combination with the `gt`, `gte`, `lt` and `lte` params), and use ***starts / ends with*** matching.
237
236
238
237
### Parameters
239
238
@@ -299,26 +298,34 @@ NOTE: **Note:** using `smart_field_search="yes"` can affect performance, dependi
299
298
300
299
## Ranges
301
300
302
-
You can use the Ranges filter to limit results by a given range, targeting a numeric or date field. If Pro Search detects that the given channel field for the range is a date field, it will try and convert the given range values to timestamps. This will allow custom date ranges as well.
301
+
Use the Ranges filter to target a numeric or date field and limit results by a given range. If Pro Search detects that the given channel field for the range is a date field, it will try and convert the given range values to timestamps. This will allow custom date ranges as well.
303
302
304
303
### Parameters
305
304
306
305
#### `range:field_name`
307
306
308
-
Takes a from and to value, separated by a vertical bar: |. Use `field_name:column_name` to target Grid/Matrix columns (v4.2.0+).
307
+
Takes both a from and to value, separated by a vertical bar: |. Use `field_name:column_name` to target Grid/Matrix columns (v4.2.0+).
308
+
309
+
range:ticket_price="20|80"
309
310
310
311
#### `range-from:field_name`
311
312
312
313
Takes a single from value. Use `field_name:column_name` to target Grid/Matrix columns (v4.2.0+).
313
314
315
+
range-from:hire_date="2020-01-01"
316
+
314
317
#### `range-to:field_name`
315
318
316
319
Takes a single to value. Use field_name:column_name to target Grid/Matrix columns (v4.2.0+).
317
320
321
+
range-to:age="65"
322
+
318
323
#### `range:min_field:max_field`
319
324
320
325
Where min and max are two separate (non-Grid/Matrix) fields. If a single value is given, entries will be returned where the value is between the min and max fields. If a from and to value is given, entries will be returned where the min and max fields overlap the given range.
321
326
327
+
range:min-deposit:max-deposit="1000"
328
+
322
329
#### `range-from:min_field:max_field`
323
330
324
331
Where min and max are two separate fields. Takes a single from value.
@@ -329,7 +336,7 @@ Where min and max are two separate fields. Takes a single to value.
329
336
330
337
#### `exclude`
331
338
332
-
Accepts parameter names. Excludes a given parameter value from the range itself. For example, `range:field_name="0|10" exclude="range:field_name"` will result in values `> 0` and `< 10` rather than `>= 0` and `<= 10`.
339
+
Accepts parameter names. Excludes a given parameter value from the range itself. For example, `range:field_name="0|10" exclude="range:field_name"` will result in search values `> 0` and `< 10` rather than `>= 0` and `<= 10`.
333
340
334
341
NOTE: **Note:** For numeric fields, make sure the Field Content option in the field’s settings is set to Number, Integer or Decimal.
335
342
@@ -350,7 +357,7 @@ Apart from any custom numeric or date field, the following standard channel fiel
350
357
351
358
## Relationships
352
359
353
-
You can use the Relationships filter to limit results by given parent or child entry IDs. The filter works for [Relationships fieldtypes](/fieldtypes/relationships.md).
360
+
Use the Relationships filter to limit results by given parent or child entry IDs. The filter works for [Relationships fieldtypes](/fieldtypes/relationships.md).
354
361
355
362
### Parameters
356
363
@@ -374,7 +381,7 @@ NOTE: **Note:** Use entry IDs instead of URL titles for better performance.
374
381
375
382
## Tags
376
383
377
-
You can use the Tags filter to limit results by given tag names or IDs. For more advanced filtering by tags, you can also divide tags into groups. The group syntax lets you combine AND and OR filtering (tag 1 or 2 and tag 3 or 4), as parameters are always combined with AND.
384
+
Use the Tags filter to limit results by given tag names or IDs. For more advanced filtering by tags, you can also divide tags into groups. The group syntax lets you combine AND and OR filtering (tag 1 or 2 and tag 3 or 4), as parameters are always combined with AND.
0 commit comments