Skip to content

Commit 486bd74

Browse files
sphilipsemiguelgrinberg
authored andcommitted
Clean up a few dangling changes
1 parent f503874 commit 486bd74

File tree

5 files changed

+9
-32
lines changed

5 files changed

+9
-32
lines changed

example-apps/internal-knowledge-search/api/app.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def indices():
8383

8484
except Exception as e:
8585
current_app.logger.warn(
86-
"Encountered error %s while fetching personas, returning default persona", e
86+
"Encountered error %s while fetching indices, returning no indices", e
8787
)
88-
return ["admin"]
88+
return []
8989

9090

9191
@app.route("/api/api_key", methods=["GET"])
@@ -174,12 +174,5 @@ def api_key():
174174
raise e
175175

176176

177-
@app.cli.command()
178-
def create_index():
179-
"""Create or re-create the Elasticsearch index."""
180-
basedir = os.path.abspath(os.path.dirname(__file__))
181-
sys.path.append(f"{basedir}/../")
182-
183-
184177
if __name__ == "__main__":
185178
app.run(port=3001, debug=True)

example-apps/internal-knowledge-search/app-ui/src/components/SearchApplicationSettings.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import React, { useEffect, useState } from "react";
22
import { useDispatch, useSelector } from "react-redux";
33
import {
44
updateAppName,
5-
updateIndices,
65
updateSearchEndpoint,
76
updateSearchPersona,
8-
updateSearchPersonaAPIKey,
9-
updateSettings,
107
} from "../store/slices/searchApplicationSettingsSlice";
118
import { useToast } from "../contexts/ToastContext";
129
import { MessageType } from "./Toast";
@@ -17,11 +14,6 @@ import {
1714
fetchIndices,
1815
fetchPersonas,
1916
} from "api/search_application";
20-
import {
21-
DATA_SOURCES,
22-
setFilterOptions,
23-
setFilterValue,
24-
} from "store/slices/filterSlice";
2517

2618
export const SearchApplicationSettings: React.FC = () => {
2719
const dispatch = useDispatch();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"search-spo": {
3-
"title": "Title",
2+
"search-mongo": {
3+
"title": "name",
44
"created": "_timestamp",
55
"previewText": "summary",
66
"fullText": "description",

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {SearchApplicationSettingsModel} from "../../models/SearchApplicationSett
44

55

66
const initialState: SearchApplicationSettingsModel = {
7-
appName: process.env.REACT_APP_SEARCH_APP_NAME || "some-search-application",
7+
appName: "some-search-application",
88
indices: [],
9-
searchEndpoint: process.env.REACT_APP_SEARCH_APP_ENDPOINT || "https://some-search-end-point.co",
9+
searchEndpoint: "https://some-search-end-point.co",
1010
searchPersona: "admin",
1111
searchPersonaAPIKey: "missing"
1212
};
@@ -23,9 +23,6 @@ export const searchApplicationSettingsSlice = createSlice({
2323
state.indices = action.payload;
2424
return state;
2525
},
26-
updateSettings: (state, action: PayloadAction<SearchApplicationSettingsModel>) => {
27-
return action.payload;
28-
},
2926
updateSearchEndpoint: (state, action: PayloadAction<string>) => {
3027
state.searchEndpoint = action.payload;
3128
return state;
@@ -41,4 +38,4 @@ export const searchApplicationSettingsSlice = createSlice({
4138
},
4239
});
4340

44-
export const { updateAppName, updateIndices, updateSettings, updateSearchEndpoint, updateSearchPersona, updateSearchPersonaAPIKey } = searchApplicationSettingsSlice.actions;
41+
export const { updateAppName, updateIndices, updateSearchEndpoint, updateSearchPersona, updateSearchPersonaAPIKey } = searchApplicationSettingsSlice.actions;

example-apps/internal-knowledge-search/env.example

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22

33
# Your Elaticsearch credentials
44
ELASTICSEARCH_URL=http://localhost:9200
5-
ELASTIC_API_KEY=
5+
ELASTIC_USERNAME=elastic
6+
ELASTIC_PASSWORD=changeme
67

78
# If you prefer using a cloud ID
89
# ELASTIC_CLOUD_ID=
910

1011
# If you prefer using username and password
11-
# ELASTIC_USERNAME=
12-
# ELASTIC_PASSWORD=
13-
14-
SEARCH_APP_NAME=changeme
15-
SEARCH_APP_USER=elastic
16-
SEARCH_APP_PASSWORD=changeme

0 commit comments

Comments
 (0)