Skip to content

Commit 85fb5ef

Browse files
authored
Update filters.md
1 parent 6d4c348 commit 85fb5ef

1 file changed

Lines changed: 23 additions & 16 deletions

File tree

docs/add-ons/pro-search/filters.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For instance, if a search form contains a `keywords` field, the [Keywords filter
1616

1717
## Keywords Filter
1818

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.
2020

2121
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.)
2222

@@ -177,7 +177,7 @@ NOTE: **Note:** When enabled, inflections and stems are only applied to keyword
177177

178178
## Categories
179179

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.
181181

182182
### `category`
183183

@@ -191,27 +191,28 @@ NOTE: **Note:** Use category IDs instead of URL titles for better performance.
191191

192192
## Distance
193193

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.
195195

196196
### Parameters
197197

198198
#### `distance:from`
199199

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.
201201

202202
distance:from="52.163298|4.505547"
203203

204204
#### `distance:to`
205205

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.
207207

208+
distance:to="store_geocode"
208209
distance:to="cf_entry_lat|cf_entry_long"
209210

210211
NOTE: **Note:** Use two separate fields instead of a single one for better performance.
211212

212213
#### `distance:radius`
213214

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.
215216

216217
distance:radius="50"
217218

@@ -223,17 +224,15 @@ The unit for the distances, either km, mi, m or yd. Defaults to km.
223224

224225
### Variables
225226

226-
The Distance filter makes this variable available in the [Results tag](/add-ons/pro-search/tags.md#exppro_searchresults):
227-
228227
#### `{pro_search_distance}`
229228

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).
231230

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`.
233232

234233
## Field Search
235234

236-
You can use the native `search:field_name` parameter to target specific fields. Additionally, Pro Search can 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.
237236

238237
### Parameters
239238

@@ -299,26 +298,34 @@ NOTE: **Note:** using `smart_field_search="yes"` can affect performance, dependi
299298

300299
## Ranges
301300

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.
303302

304303
### Parameters
305304

306305
#### `range:field_name`
307306

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"
309310

310311
#### `range-from:field_name`
311312

312313
Takes a single from value. Use `field_name:column_name` to target Grid/Matrix columns (v4.2.0+).
313314

315+
range-from:hire_date="2020-01-01"
316+
314317
#### `range-to:field_name`
315318

316319
Takes a single to value. Use field_name:column_name to target Grid/Matrix columns (v4.2.0+).
317320

321+
range-to:age="65"
322+
318323
#### `range:min_field:max_field`
319324

320325
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.
321326

327+
range:min-deposit:max-deposit="1000"
328+
322329
#### `range-from:min_field:max_field`
323330

324331
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.
329336

330337
#### `exclude`
331338

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`.
333340

334341
NOTE: **Note:** For numeric fields, make sure the Field Content option in the field’s settings is set to Number, Integer or Decimal.
335342

@@ -350,7 +357,7 @@ Apart from any custom numeric or date field, the following standard channel fiel
350357

351358
## Relationships
352359

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).
354361

355362
### Parameters
356363

@@ -374,7 +381,7 @@ NOTE: **Note:** Use entry IDs instead of URL titles for better performance.
374381

375382
## Tags
376383

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.
378385

379386
### Parameters
380387

0 commit comments

Comments
 (0)