Skip to content

Commit fdb2dce

Browse files
authored
Merge pull request #2 from swiftype/readme-cut
README: Creates a table, minor changes, and moderate re-organization.
2 parents 633008e + 57ea232 commit fdb2dce

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

README.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@
33
The Reference UI is a configurable, generic UI meant to work with
44
any [App Search](https://www.elastic.co/cloud/app-search-service) Engine. It
55
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
77
UI.
88

99
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...
1111

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
1515

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

1818
## Setup
1919

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"
2321
installed, you should be able to use the `npm` command from within your
2422
terminal.
2523

@@ -38,16 +36,38 @@ npm install
3836
npm start
3937
```
4038

41-
#### Updating configuration
39+
### Updating configuration
4240

4341
If you would like to make configuration changes, there is no need to regenerate
4442
this app from your App Search Dashboard! You can simply open up the
4543
[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 <a id="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`.
4767

48-
### If you're checking this project out directly from github
68+
### If you are checking this project out directly from GitHub... <a id="github"></a>
4969

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
5171
[engine.json](src/config/engine.json).
5272

5373
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.
5676
```bash
5777
cp src/config/engine.json.example src/config/engine.json
5878
```
59-
60-
## Configuration options <a id="config"></a>
61-
62-
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

Comments
 (0)