Skip to content

Commit 8b64baa

Browse files
committed
Added SPO source
1 parent 8620d76 commit 8b64baa

File tree

7 files changed

+36
-9
lines changed

7 files changed

+36
-9
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
SEARCH_APP_NAME=some-search-application
2-
SEARCH_APP_API_KEY=xxxxxxxxxxxxxxxxxxx
3-
SEARCH_APP_ENDPOINT=https://some-search-end-point.co
1+
REACT_APP_SEARCH_APP_NAME=changeme
2+
REACT_APP_SEARCH_APP_API_KEY=changeme
3+
REACT_APP_SEARCH_APP_ENDPOINT=http://localhost:9200

example-apps/internal-knowledge-search/app-ui/README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,24 @@ To be able to use the index filtering and sorting in the UI you should update th
106106

107107
### Setting the environment variables
108108

109-
You need to set `SEARCH_APP_NAME`, `SEARCH_APP_API_KEY` and `SEARCH_APP_ENDPOINT` inside [.env](.env) to the corresponding values, which you'll get when [creating a search application](https://www.elastic.co/guide/en/enterprise-search/current/search-applications.html).
109+
You need to set `REACT_APP_SEARCH_APP_NAME`, `REACT_APP_SEARCH_APP_API_KEY` and `REACT_APP_SEARCH_APP_ENDPOINT` inside [.env](.env) to the corresponding values, which you'll get when [creating a search application](https://www.elastic.co/guide/en/enterprise-search/current/search-applications.html).
110110

111+
### Set up DLS with SPO
112+
1. create a connector in kibana named `search-sharepoint`
113+
2. start connectors-python, if using connector clients
114+
3. enable DLS
115+
4. run an access control sync
116+
5. run a full sync
117+
6. define mappings, as above in this README
118+
7. create search application
119+
8. enable cors: https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-security.html#search-application-security-cors-elasticsearch
120+
121+
122+
### Make it go
123+
124+
When it's time to actually start it up:
125+
126+
```
127+
npm install
128+
npm run start
129+
```
7.38 KB
Loading
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"search-mongo": "data-source-logos/mongodb_logo.webp",
33
"search-mongo-2": "data-source-logos/mongodb_logo.webp",
4-
"search-mysql": "data-source-logos/mysql.webp"
4+
"search-mysql": "data-source-logos/mysql.webp",
5+
"search-sharepoint": "data-source-logos/sharepoint_icon.webp"
56
}

example-apps/internal-knowledge-search/app-ui/src/config/documentsToSearchResultMappings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,12 @@
1212
"previewText": "summary",
1313
"fullText": "description",
1414
"link": "listing_url"
15+
},
16+
"search-sharepoint": {
17+
"title": "name",
18+
"created": "createdDateTime",
19+
"previewText": "body",
20+
"fullText": "body",
21+
"link": "webUrl"
1522
}
1623
}

example-apps/internal-knowledge-search/app-ui/src/store/slices/filterSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface FilterState {
88
const initialState: FilterState = {
99
//TODO: fetch via API somewhere else
1010
filters: {
11-
"Data sources": {options: ["search-mongo", "search-mongo-2", "search-mysql"], values: ["search-mongo"]}
11+
"Data sources": {options: ["search-mongo", "search-mongo-2", "search-mysql", "search-sharepoint"], values: ["search-sharepoint"]}
1212
}
1313
};
1414

example-apps/internal-knowledge-search/app-ui/src/store/slices/searchApplicationSettingsSlice.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {createSlice, PayloadAction} from '@reduxjs/toolkit';
22
import {SearchApplicationSettingsModel} from "../../models/SearchApplicationSettingsModel";
33
const initialState: SearchApplicationSettingsModel = {
4-
appName: process.env.SEARCH_APP_NAME || "some-search-application",
5-
apiKey: process.env.SEARCH_APP_API_KEY || "xxxxxxxxxxxxxxxxxxx",
6-
searchEndpoint: process.env.SEARCH_APP_ENDPOINT || "https://some-search-end-point.co",
4+
appName: process.env.REACT_APP_SEARCH_APP_NAME || "some-search-application",
5+
apiKey: process.env.REACT_APP_SEARCH_APP_API_KEY || "xxxxxxxxxxxxxxxxxxx",
6+
searchEndpoint: process.env.REACT_APP_SEARCH_APP_ENDPOINT || "https://some-search-end-point.co",
77
};
88

99
const searchApplicationSettingsSlice = createSlice({

0 commit comments

Comments
 (0)