Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(semantic_search): extend register_search, add endpoint_name #467

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/semantic_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ search_selection_choices <- function(input_id,
#' @param data Data (the value that is passed into registerDataObj)
#' @param search_query Function providing a response as a list of
#' lists or dataframe of search results.
#'
#' @param endpoint_name (optional) name your endpoint (useful when you have multiple search api on your app)
#' @examples
#' if (interactive()) {
#' library(shiny)
Expand Down Expand Up @@ -263,8 +263,8 @@ search_selection_choices <- function(input_id,
#'
#' @export
#' @import shiny
register_search <- function(session, data, search_query) {
session$registerDataObj("search_api", data, function(data, request) { # nolint
register_search <- function(session, data, search_query,endpoint_name="search_api") {
session$registerDataObj(endpoint_name, data, function(data, request) { # nolint
query <- shiny::parseQueryString(request$QUERY_STRING)
extracted_query <- query$q
response <- jsonlite::toJSON(list(
Expand Down