blob: fc68d1509285a0305e1be5b8fdc231a821b0da53 [file] [log] [blame]
Marc Kupietzcf1caf42019-09-07 19:19:31 +02001% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/KorAPQuery.R
3\name{KorAPQuery}
4\alias{KorAPQuery}
Marc Kupietz62da2b52019-09-12 17:43:34 +02005\title{Send a query to a KorAP connection.}
Marc Kupietzcf1caf42019-09-07 19:19:31 +02006\usage{
Marc Kupietz3c531f62019-09-13 12:17:24 +02007KorAPQuery(con, query = NA, vc = NA, KorAPUrl = NA,
8 metadataOnly = TRUE, ql = "poliqarp", fields = defaultFields,
9 accessRewriteFatal = TRUE)
Marc Kupietzcf1caf42019-09-07 19:19:31 +020010}
11\arguments{
12\item{con}{object obtained from \code{\link{KorAPConnection}}, that contains all necessary connection information}
13
14\item{query}{string that contains the corpus query. The query langauge depends on the \code{ql} parameter. Either \code{query} must be provided or \code{KorAPUrl}}
15
16\item{vc}{string describing the virtual corpus in which the query should be performed. An empty string (default) means the whole corpus, as far as it is license-wise accessible.}
17
18\item{KorAPUrl}{instead of providing the query and vc string parameters, you can also simply copy a KorAP query URL from your browser and use it here (and in \code{KorAPConnection}) to provide all necessary information for the query.}
19
Marc Kupietzb125bdd2019-09-09 12:05:59 +020020\item{metadataOnly}{boolean that determines whether queries should return only metadata without any snippets. This can also be useful to prevent access rewrites. Note that the default value is TRUE, unless the connection is authorized (currently not possible).}
Marc Kupietzb3065522019-09-09 11:34:19 +020021
Marc Kupietz3c531f62019-09-13 12:17:24 +020022\item{ql}{string to choose the query language (see \href{https://github.com/KorAP/Kustvakt/wiki/Service:-Search-GET#user-content-parameters}{section on Query Parameters} in the Kustvakt-Wiki for possible values.}
Marc Kupietzcf1caf42019-09-07 19:19:31 +020023
Marc Kupietzb125bdd2019-09-09 12:05:59 +020024\item{fields}{(meta)data fields that will be fetched for every match}
Marc Kupietzcf1caf42019-09-07 19:19:31 +020025}
Marc Kupietz7bce47d2019-09-09 11:53:11 +020026\value{
Marc Kupietz62da2b52019-09-12 17:43:34 +020027A KorAP query object that, among other information, contains the total number of results in \code{$meta$totalResults}. The resulting object can be used to fetch all query results (with \code{\link{KorAPFetchAll}}) or the next page of results (with \code{\link{KorAPFetchNext}}).
28A correspunding URL to be used within a web browser is contained in \code{$webUIRequestUrl}
29Please make sure to check \code{$collection$rewrites} to see if any unforseen access rewrites of the query's virtual corpus had to be performed.
Marc Kupietz7bce47d2019-09-09 11:53:11 +020030}
Marc Kupietzcf1caf42019-09-07 19:19:31 +020031\description{
Marc Kupietz62da2b52019-09-12 17:43:34 +020032Send a query to a KorAP connection.
Marc Kupietzcf1caf42019-09-07 19:19:31 +020033}
34\examples{
Marc Kupietz3c531f62019-09-13 12:17:24 +020035con <- KorAPConnection()
Marc Kupietzcf1caf42019-09-07 19:19:31 +020036q <- KorAPQuery(con, "Ameisenplage")
Marc Kupietz3c531f62019-09-13 12:17:24 +020037q <- KorAPFetchAll(q)
38summary(q$collectedMatches)
39
Marc Kupietzcf1caf42019-09-07 19:19:31 +020040q <- KorAPQuery(con, KorAPUrl = "https://korap.ids-mannheim.de/?q=Ameise&cq=pubDate+since+2017&ql=poliqarp&cutoff=1")
Marc Kupietz3c531f62019-09-13 12:17:24 +020041q$meta$totalResults
Marc Kupietzcf1caf42019-09-07 19:19:31 +020042
43}
44\references{
45\url{https://ids-pub.bsz-bw.de/frontdoor/index/index/docId/9026}
46}
Marc Kupietz3c531f62019-09-13 12:17:24 +020047\seealso{
48\code{\link{KorAPConnection}}, \code{\link{KorAPFetchNext}}, \code{\link{KorAPFetchRest}}, \code{\link{KorAPFetchAll}}, \code{\link{KorAPCorpusStats}}
49}