refactor: get index from .env
This commit is contained in:
parent
dd1547d7c2
commit
1c3ac35ed1
3 changed files with 21 additions and 21 deletions
|
|
@ -11,7 +11,7 @@ export class SearchController extends Controller {
|
|||
@SuccessResponse(HttpStatusCode.OK)
|
||||
public async searchFile(@Body() search: Search): Promise<EhrFile[]> {
|
||||
const result = await esClient.search<EhrFile & { attachment: Record<string, string> }>({
|
||||
index: "ehr-api-client",
|
||||
index: process.env.ELASTICSEARCH_INDEX ?? 'ehr-index',
|
||||
query: {
|
||||
bool: {
|
||||
must: search.AND?.map((v) => ({ match: { [v.field]: v.value } })),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue