Arguments
- search_string
character
; string to search using parameterized search or SOSL. Note that is_sosl must be set to TRUE and the string valid in order to perform a search using SOSL.- is_sosl
logical
; indicating whether or not to try the string as SOSL- guess_types
logical
; indicating whether or not to usecol_guess()
to try and cast the data returned in the recordset. IfTRUE
thencol_guess()
is used along withanytime()
andanydate()
. IfFALSE
then all fields will be returned as character. SpecifyingFALSE
helpful when guessing the column data type will result in NA values and you would like to return the results as strings and then cast in your script according to your unique specifications.- api_type
character
; one of"REST"
,"SOAP"
,"Bulk 1.0"
, or"Bulk 2.0"
indicating which API to use when making the request.- parameterized_search_options
list
; a list of parameters for controlling the search if not using SOSL. If using SOSL this argument is ignored.- verbose
logical
; an indicator of whether to print additional detail for each API call, which is useful for debugging. More specifically, when set toTRUE
the URL, header, and body will be printed for each request, along with additional diagnostic information where available.- ...
arguments to be used to form the parameterized search options argument if it is not supplied directly.
Note
The maximum number of returned rows in the SOSL query results is 2,000. Please refer to the limits HERE for more detail.
References
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl.htm
Examples
if (FALSE) { # \dontrun{
# free text search
area_code_search_string <- "(336)"
search_result <- sf_search(area_code_search_string)
# free text search with parameters
search_result <- sf_search(area_code_search_string,
fields_scope = "PHONE",
objects = "Lead",
fields = c("id", "phone", "firstname", "lastname"))
# using SOSL
my_sosl_search <- paste("FIND {(336)} in phone fields returning",
"contact(id, phone, firstname, lastname),",
"lead(id, phone, firstname, lastname)")
sosl_search_result <- sf_search(my_sosl_search, is_sosl=TRUE)
} # }