Skip to content

Commit c271437

Browse files
authored
Merge pull request #97 from elastic/Update-readme
Update README.md
2 parents ca1d1af + c5d13a7 commit c271437

File tree

1 file changed

+47
-52
lines changed

1 file changed

+47
-52
lines changed

README.md

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
1-
<p align="center"><img src="https://github.com/elastic/app-search-reference-ui-react/blob/master/logo-app-search.png?raw=true" alt="Elastic App Search Logo"></p>
2-
3-
> A configurable, generic search UI for
4-
> any [Elastic App Search](https://www.elastic.co/products/app-search) Engine.
5-
61
## Contents
72

83
- [Getting started](#getting-started-)
94
- [Usage](#usage)
105
- [FAQ](#faq-)
11-
- [Contribute](#contribute-)
126
- [License](#license-)
137

148
---
159

1610
## Getting started 🐣
1711

18-
The Reference UI is great for:
12+
This is a generated search experience created with [Search UI](https://github.com/elastic/search-ui).
1913

20-
- search demos
21-
- functional tests of App Search Engine data
22-
- a starting point for new search experiences
14+
To set up and run this project, follow the instructions below.
2315

2416
Requires [npm](https://www.npmjs.com/).
2517

@@ -36,8 +28,6 @@ nvm install 16.13.0
3628
nvm use 16.13.0
3729
```
3830

39-
The README assumes that you have generated this code from within the App Search dashboard.
40-
4131
Run the following commands to start this application:
4232

4333
```bash
@@ -57,16 +47,7 @@ npm start
5747

5848
### Updating configuration
5949

60-
The project can be configured via a JSON [config file](src/config/engine.json).
61-
62-
You can easily control things like...
63-
64-
- The Engine the UI runs against
65-
- Which fields are displayed
66-
- The filters that are used
67-
68-
If you would like to make configuration changes, there is no need to regenerate
69-
this app from your App Search Dashboard!
50+
The project is configured via a JSON [config file](src/config/engine.json). This file has been automatically generated for you when downloading this project. If you would like to make configuration changes, there is no need to regenerate this app from your App Search Dashboard. Additional configuration can be made by modifying that file.
7051

7152
You can simply open up the
7253
[engine.json](src/config/engine.json) file, update the [options](#config),
@@ -79,8 +60,7 @@ The following is a complete list of options available for configuration in [engi
7960
| option | value type | required/optional | source |
8061
| -------------------- | ------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8162
| `engineName` | String | required | Found in your App Search Dashboard. |
82-
| `endpointBase` | String | required* | (*) Elastic Enterprise Search deployment URL, example: "http://127.0.0.1:3002". Not required if using App Search on swiftype.com. |
83-
| `hostIdentifier` | String | required* | (*) Only required if using App Search on swiftype.com. |
63+
| `endpointBase` | String | required* | (*) Elastic Enterprise Search deployment URL, example: "http://127.0.0.1:3002". |
8464
| `searchKey` | String | required | Found in your App Search Dashboard. |
8565
| `searchFields` | Array[String] | required | A list of fields that will be searched with your search term. |
8666
| `resultFields` | Array[String] | required | A list of fields that will be displayed within your results. |
@@ -90,22 +70,31 @@ The following is a complete list of options available for configuration in [engi
9070
| `sortFields` | Array[String] | optional | A list of fields that will be used for sort options. |
9171
| `facets` | Array[String] | optional | A list of fields that will be available as "facet" filters. Read more about facets within the [App Search documentation](https://www.elastic.co/guide/en/app-search/current/facets-guide.html). |
9272

93-
### External configuration
94-
95-
If you are embedding this app inside of another page, and you would like to
96-
source the configuration from outside of the `engine.json` file,
97-
you can simply write the configuration directly to `window.appConfig`.
73+
## Building and embedding
9874

99-
### If you are checking this project out directly from GitHub... <a id="github"></a>
100-
101-
You can follow the previous steps, but then you will need to configure
102-
[engine.json](src/config/engine.json).
75+
To embed this application into a website, it can be built into static assets using the following command:
76+
```
77+
npm run build
78+
```
10379

104-
To do so, make a copy of [engine.json.example](src/config/engine.json.example),
105-
rename it to `engine.json` and configure it with your Engine's specific details.
80+
This will create two files in the `build` directory:
81+
```
82+
build/static/js/main.<hash>.js
83+
build/static/css/main.<hash>.css
84+
```
10685

107-
```bash
108-
cp src/config/engine.json.example src/config/engine.json
86+
Include the built static assets as well as an element with `id="root"`. For example:
87+
```html
88+
<!DOCTYPE html>
89+
<html lang="en">
90+
<head>
91+
<script defer="defer" src="/static/js/main.<hash>.js"></script>
92+
<link href="/static/css/main.<hash>.css" rel="stylesheet" />
93+
</head>
94+
<body>
95+
<div id="root" class="app-container"></div>
96+
</body>
97+
</html>
10998
```
11099

111100
## Deploy and Share
@@ -122,34 +111,40 @@ netlify deploy # enter ./build as the deploy path
122111

123112
You'll then simply follow the command prompt to log into Netlify and deploy your site. This can be completed in just a few minutes.
124113

114+
### External configuration
115+
116+
If you are embedding this app inside of another page, and you would like to
117+
source the configuration from outside of the `engine.json` file,
118+
you can simply write the configuration directly to `window.appConfig`.
119+
120+
### If you are checking this project out directly from GitHub... <a id="github"></a>
121+
122+
You can follow the previous steps, but then you will need to create and configure
123+
[engine.json](src/config/engine.json).
124+
125+
To do so, make a copy of [engine.json.example](src/config/engine.json.example),
126+
rename it to `engine.json` and configure it with your Engine's specific details.
127+
128+
```bash
129+
cp src/config/engine.json.example src/config/engine.json
130+
```
131+
125132
## Customization
126133

127134
This project is built with [Search UI](https://github.com/elastic/search-ui), which is a React library for building search experiences. If you're interested in using this project as a base for your own, most of
128135
what you'll need can be found in the Search UI documentation.
129136

130137
## FAQ 🔮
131138

132-
### Where do I report issues with the Reference UI?
139+
### Where do I report issues with this application?
133140

134141
If something is not working as expected, please open an [issue](https://github.com/elastic/app-search-reference-ui-react/issues/new).
135142

136-
### Where can I learn more about App Search?
137-
138-
Your best bet is to read the [documentation](https://www.elastic.co/guide/en/app-search/current).
139143

140144
### Where else can I go to get help?
141145

142-
You can checkout the [Elastic App Search community discuss forums](https://discuss.elastic.co/c/app-search).
143-
144-
## Contribute 🚀
145-
146-
We welcome contributors to the project. Before you begin, a couple notes...
147-
148-
- Before opening a pull request, please create an issue to [discuss the scope of your proposal](https://github.com/elastic/app-search-reference-ui-react/issues).
149-
- Please write simple code and concise documentation, when appropriate.
146+
You can checkout the [Elastic Enterprise Search community discuss forums](https://discuss.elastic.co/c/enterprise-search/84).
150147

151148
## License 📗
152149

153-
[Apache-2.0](https://github.com/elastic/app-search-reference-ui-react/blob/master/LICENSE.md) © [Elastic](https://github.com/elastic)
154-
155-
Thank you to all the [contributors](https://github.com/elastic/app-search-reference-ui-react/graphs/contributors)!
150+
[Apache-2.0](https://github.com/elastic/app-search-reference-ui-react/blob/master/LICENSE.txt) © [Elastic](https://github.com/elastic)

0 commit comments

Comments
 (0)