#' @import shiny
app_server <- function(input, output, session) {
# All indices in the ES server
rv <- reactiveValues()
rv$allIndices <- elastic::index_stats(esConn, index = NULL, metric = c("docs", "store"))$indices
# List the first level callModules here
indexSelected <- callModule(mod_index_chooser_server, "index_chooser_ui_1", rv$allIndices, "medical_notes")
observe(print(indexSelected()))
}
# Values for Elasticsearch connection
esUser <- Sys.getenv("ELASTICSEARCH_USER")
esPassword <- Sys.getenv("ELASTICSEARCH_PASSWORD")
esHost <- ifelse(Sys.getenv("ELASTICSEARCH_HOST") == "", "localhost", Sys.getenv("ELASTICSEARCH_HOST"))
esPort <- ifelse(Sys.getenv("ELASTICSEARCH_PORT") == "", 8080, Sys.getenv("ELASTICSEARCH_PORT"))
esDefaultIndex <- ifelse(Sys.getenv("ELASTICSEARCH_INDEX") == "", "medical_notes_2020", Sys.getenv("ELASTICSEARCH_INDEX"))
if (esUser == "") {
esConn <- elastic::connect(host = esHost,
port = esPort,
transport_schema = "http")
} else {
esConn <- elastic::connect(host = esHost,
port = esPort,
transport_schema = "http",
user = esUser,
pwd = esPassword)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.