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
@@ -58,9 +58,9 @@ Be sure to change the `engineKey` attribute shown above to match the one assigne
58
58
Customization Tutorial
59
59
-------------
60
60
61
-
This plugin is written to be flexible based on your specific use-case.
61
+
This plugin is written to be flexible based on your specific use-case.
62
62
For example you might want to retrieve more data for each result, customize
63
-
the way data is display to the user, or restrict the search query to certain elements of your search engine.
63
+
the way data is display to the user, or restrict the search query to certain elements of your search engine.
64
64
65
65
Let's go through an example that does all of this. For this example, let's assume you followed the QuickStart tutorial for our [Ruby Gem](https://github.com/swiftype/swiftype-rb), and now you have data for a Bookstore indexed in your example search engine.
66
66
@@ -69,12 +69,12 @@ Let's go through an example that does all of this. For this example, let's assum
69
69
To specify the number of results per page, use the `perPage` attribute.
70
70
71
71
```js
72
-
$('#st-search-input').swiftypeSearch({
72
+
$('#st-search-input').swiftypeSearch({
73
73
engineKey:'jaDGyzkR6iYHkfNsPpNK',
74
74
perPage:20
75
75
});
76
76
```
77
-
77
+
78
78
The maximium value that will be honored by the API is 100.
79
79
80
80
#### Returning a matching highlight snippet
@@ -101,7 +101,7 @@ See the [custom.html](https://github.com/swiftype/swiftype-search-jquery/blob/ma
101
101
To specify the fields you would like returned from the API, set the `fetchFields` attribute to a hash containing an array listing the fields you want returned for each document type. For example, if you have indexed `title`, `genre`, and `published_on` fields for each document, you can have them returned as follows:
@@ -133,7 +133,7 @@ var customRenderFunction = function(document_type, item) {
133
133
Now simply set the `renderFunction` attribute in the options dictionary to your `customRenderFunction` to tell our plugin to use your function to render results:
By default, the Swiftype search library will match the submitted query to any `string` or `text` field indexed for your documents. So if you would like to ensure that it only matches entries in the `title` field, for example, you can specify the `searchFields` option:
Similarly to the `fetchFields` option, `searchFields` accepts a hash containing an array of fields for each document_type on which you would like the user's query to match.
156
+
Similarly to the `fetchFields` option, `searchFields` accepts a hash containing an array of fields for each document_type on which you would like the user's query to match.
157
157
158
158
#### Specifying additional query conditions
159
159
160
160
Now let's say you only want your results to display books that are of the **fiction**`genre` and are **in_stock**. In order to restrict search results, you can pass additional query conditions to the search API by specifying them as a dictionary in the `filters` field. Multiple clauses in the filters field are combined with AND logic:
0 commit comments