I am trying to build a Shiny app that is a search engine. I am returning a data.table based on the search keywords:
DT <- data.table(field = c("A_B_C","A_C_D","A_D_A","B_A_D","B_C_F","B_D_K"))
DT[field %like% "A|B"]
The above returns all fields containing A OR B. If I want to have A & B:
DT[field %like% "A"][field %like% "B"]
Is there a syntax that will allow me to do the above for any number of keywords. Something like:
DT[field %like% "A & B & C"]