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: README.md
+33-33Lines changed: 33 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,21 @@
3
3
The Reference UI is a configurable, generic UI meant to work with
4
4
any [App Search](https://www.elastic.co/cloud/app-search-service) Engine. It
5
5
can serve as a simple demo, a functional test for your Engine data,
6
-
and also a code reference to use when building out your own App Search
6
+
or as a code reference when building out your own App Search
7
7
UI.
8
8
9
9
The project can be configured via a JSON [config file](src/config/engine.json),
10
-
which allows you to easily control things like:
10
+
which allows you to easily control things like...
11
11
12
-
-What Engine this UI runs against
13
-
-What fields are displayed
14
-
-What filters are used
12
+
-The Engine the UI runs against
13
+
-Which fields are displayed
14
+
-The filters that are used
15
15
16
-
A complete list of configuration options can be found [below](#config).
16
+
The README assumes that you have generated this code from within the App Search dashboard.
17
17
18
18
## Setup
19
19
20
-
### If you just downloaded this via the Dashboard
21
-
22
-
You'll need to install [npm](https://www.npmjs.com/). Once you have "npm"
20
+
You will need to install [npm](https://www.npmjs.com/). Once you have "npm"
23
21
installed, you should be able to use the `npm` command from within your
24
22
terminal.
25
23
@@ -38,16 +36,38 @@ npm install
38
36
npm start
39
37
```
40
38
41
-
####Updating configuration
39
+
### Updating configuration
42
40
43
41
If you would like to make configuration changes, there is no need to regenerate
44
42
this app from your App Search Dashboard! You can simply open up the
45
43
[engine.json](src/config/engine.json) file, update the [options](#config),
46
-
and restart this app.
44
+
and then restart this app.
45
+
46
+
### Configuration options <aid="config"></a>
47
+
48
+
The following is a complete list of options available for configuration in [engine.json](src/config/engine.json).
49
+
50
+
| option | value type | required/optional | source
51
+
| --- | --- | --- | --- |
52
+
|`engineName`| String | required | Found in your [App Search Dashboard](http://app.swiftype.com/as). |
53
+
|`hostIdentifier`| String | required | Found in your [App Search Dashboard](http://app.swiftype.com/as). |
54
+
|`searchKey`| String | required | Found in your [App Search Dashboard](http://app.swiftype.com/as). |
55
+
|`fields`| Array[String]| required | A list of fields that will be searched and displayed within your results. |
56
+
|`titleField`| String | optional | The field to display as the title in results. |
57
+
|`urlField`| String | optional | A field with a url to use as a link in results. |
58
+
|`urlFieldTemplate`| String | optional | Instead of urlField, you can provide a URL "template" here, which lets you build a URL from other fields. ex: "https://www.example.com/{{id}}".|
59
+
|`sortFields`| Array[String]| required | A list of fields that will be used for sort options. |
60
+
|`facets`| Array[String]| required | A list of fields that will be available as "facet" filters. Read more about facets within the [App Search documentation](https://swiftype.com/documentation/app-search/guides/facets). |
61
+
62
+
### External configuration
63
+
64
+
If you are embedding this app inside of another page, and you would like to
65
+
source the configuration from outside of the `engine.json` file,
66
+
you can simply write the configuration directly to `window.appConfig`.
47
67
48
-
### If you're checking this project out directly from github
68
+
### If you are checking this project out directly from GitHub... <aid="github"></a>
49
69
50
-
Follow the previous steps, but you'll also need to configure
70
+
You can follow the previous steps, but then you will need to configure
51
71
[engine.json](src/config/engine.json).
52
72
53
73
To do so, make a copy of [engine.json.example](src/config/engine.json.example),
@@ -56,23 +76,3 @@ rename it to `engine.json` and configure with your Engine's specific details.
The following is a complete list of options available for configuraiton in [engine.json](src/config/engine.json).
63
-
64
-
- engineName - (String) Found in your [App Search Dashboard](http://app.swiftype.com/as)
65
-
- hostIdentifier - (String) Found in your [App Search Dashboard](http://app.swiftype.com/as)
66
-
- searchKey - (String) Found in your [App Search Dashboard](http://app.swiftype.com/as)
67
-
- fields - (Array[String]) A list of fields that will be searched, and also displayed in results
68
-
- titleField - (String)(Optional) The field to display as the title in results
69
-
- urlField - (String)(Optional) A field with a url to use as a link in results
70
-
- urlFieldTemplate - (String)(Optional) Instead of urlField, you can provide a URL "template" here, which lets you build a URL from other fields. ex: "http://www.example.com/{{id}}"
71
-
- sortFields - (Array[String]) A list of fields that will be used for sort options
72
-
- facets - (Array[String]) A list of fields that will be available as "facet" filters
73
-
74
-
## External configuration
75
-
76
-
If you are embedding this app inside of another page, and you'd like to
77
-
source the configuration from outside of the `engine.json` file,
78
-
you can simply write the configuration directly to `window.appConfig`.
0 commit comments