blob: 89ea8fe66a3ef5dbce38e801ac3717b1ebb7eb25 [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 Kupietzf568f3f2019-09-16 17:03:46 +02007KorAPQuery(con, query, vc = "", KorAPUrl, metadataOnly = TRUE,
8 ql = "poliqarp", fields = defaultFields, accessRewriteFatal = TRUE)
Marc Kupietzcf1caf42019-09-07 19:19:31 +02009}
10\arguments{
11\item{con}{object obtained from \code{\link{KorAPConnection}}, that contains all necessary connection information}
12
13\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}}
14
15\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.}
16
17\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.}
18
Marc Kupietzb125bdd2019-09-09 12:05:59 +020019\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 +020020
Marc Kupietz3c531f62019-09-13 12:17:24 +020021\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 +020022
Marc Kupietzb125bdd2019-09-09 12:05:59 +020023\item{fields}{(meta)data fields that will be fetched for every match}
Marc Kupietzcf1caf42019-09-07 19:19:31 +020024}
Marc Kupietz7bce47d2019-09-09 11:53:11 +020025\value{
Marc Kupietz62da2b52019-09-12 17:43:34 +020026A 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}}).
27A correspunding URL to be used within a web browser is contained in \code{$webUIRequestUrl}
28Please 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 +020029}
Marc Kupietzcf1caf42019-09-07 19:19:31 +020030\description{
Marc Kupietz62da2b52019-09-12 17:43:34 +020031Send a query to a KorAP connection.
Marc Kupietzcf1caf42019-09-07 19:19:31 +020032}
33\examples{
Marc Kupietz3c531f62019-09-13 12:17:24 +020034con <- KorAPConnection()
Marc Kupietzcf1caf42019-09-07 19:19:31 +020035q <- KorAPQuery(con, "Ameisenplage")
Marc Kupietz3c531f62019-09-13 12:17:24 +020036q <- KorAPFetchAll(q)
37summary(q$collectedMatches)
38
Marc Kupietzcf1caf42019-09-07 19:19:31 +020039q <- 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 +020040q$meta$totalResults
Marc Kupietzcf1caf42019-09-07 19:19:31 +020041
42}
43\references{
44\url{https://ids-pub.bsz-bw.de/frontdoor/index/index/docId/9026}
45}
Marc Kupietz3c531f62019-09-13 12:17:24 +020046\seealso{
47\code{\link{KorAPConnection}}, \code{\link{KorAPFetchNext}}, \code{\link{KorAPFetchRest}}, \code{\link{KorAPFetchAll}}, \code{\link{KorAPCorpusStats}}
48}