This package contains convenience functions for testing our site search.
After you have installed R, first time R users will need to install the following packages:
install.packages(c("devtools", "dplyr", "xml2", "rvest", "httr", "curl", "tidyr", "stringi"))
You will then need to install this package:
library(devtools)
install_github("kyeager4/ksulibSearch")
Once the packages are installed, you do not have to re-install them the next time you launch R.
If there are changes to the code in this package, you can rerun install_github("kyeager4/ksulibSearch")
to update to the most recent version.
To use this package:
## Load this package (only needs to be done once, at the start of your R session.)
library(ksulibSearch)
## Test a single query on the production site.
query_example1 <- run_ksu_search("hours")
## Test a single query on the test server.
query_example2 <- run_ksu_search("hours", production=FALSE)
## You can also test more than one query at a time by supplying a character vector.
## Use quotations around each query, and separate each query by a comma.
myterms <- c("hours", "locations", "academic search complete")
query_example3 <- run_ksu_search(myterms)
query_example4 <- run_ksu_search(myterms, production=FALSE)
This package is a work in progress.
High priority:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.