Skip to contents

Query the GESIS search engine to retrieve metadata on research data, variables, tools, publications, libraries, and websites.

Usage

gesis_search(
  query = NULL,
  type = NULL,
  default_operator = "AND",
  fields = field_weights(),
  sort = "relevance",
  publication_year = NULL,
  countries = NULL,
  topics = NULL,
  authors = NULL,
  sources = NULL,
  study_title = NULL,
  study_group = NULL,
  collection_year = NULL,
  thematic_collections = NULL,
  method_data_collection = NULL,
  method_sampling = NULL,
  method_time = NULL,
  method_unit = NULL,
  data_type = NULL,
  interview_language = NULL,
  pages = 1,
  tidy = FALSE
)

# S3 method for class 'gesis_records'
as.data.frame(x, ...)

Arguments

query

The search term to query. Terms can be seperated by operators OR / AND. If no operator is specified, defaults to the operator specified in default_operator. If NULL, searches for all records. Queryless searches can still be filtered using the parameters below.

type

Type of search results to retrieve. Can be one of "research_data", "variables", "instruments_tools", "publication", "gesis_bib", or "gesis_web" or "gesis_person". If NULL, includes all result types. Defaults to NULL.

default_operator

Character specifying the default operator to use as seperator of search terms. Can be "AND" or "OR". Defaults to "AND". Ignored if query is NULL.

fields

Character vector of field weights as returned by field_weights. Used to specify how much weight is given to query matches in certain metadata fields. The higher the weight, the more a field influences the match probability. Defaults to the default values specified by field_weights. Ignored if query is NULL.

sort

Attribute to sort by. Must be one of "relevance", "newest_first", "oldest_first", "title_ascending", "title_descending", "variable_ascending", or "variable_descending". Defaults to "relevance".

publication_year

Numeric or character vector of length 2 specifying the time range in which a record was published. The first value is the start year and the second value is the end year. If NULL, returns records from all years. Defaults to NULL.

countries

Character vector specifying the country in which the record was published. If NULL, returns records from all countries. Defaults to NULL.

topics

Character vector specifying the topics to filter by. Example values include "Political behavior and attitudes" or "Migration". See https://search.gesis.org/ for a full list of possible topics.

authors

Character vector specifying the authors to filter by.

sources

Character vector specifying the source of the record.

study_title

Character vector specifying the study title. Only sensible for research data or variables.

study_group

Character vector specifying the study group. Only sensible for research data or variables.

collection_year

Numeric or character vector of length 2 specifying the time range in which a dataset was collected. The first value is the start year and the second value is the end year. If NULL, returns records from all years. Defaults to NULL. Only sensible for research data or variables.

thematic_collections

Character vector specifying the thematic collection a dataset or variable belongs to. Example values include "COVID-19" or "Environment and climate". See https://search.gesis.org/ for a full list of possible topics.

method_data_collection, method_sampling, method_time, method_unit

Arguments to filter by the methodology used in a study. It is possible to filter by the mode of data collection (method_data_collection), sampling procedure (method_sampling), temporal research design (method_unit) and analysis unit (method_unit). Only sensible for research data and variables.

data_type

Character vector specifying the data type of a dataset or variable. Example values include "numeric", "geospatial", and "text". Only sensible for research data and variables.

interview_language

Character vector specifying the interview language of a variable. Usually only "german" and "english" are available. Only sensible for variables.

pages

Numeric vector specifying the page numbers of the search results. By default, only the first page is returned. If NULL, iterates through all pages.

tidy

If TRUE, returns the records in a rectangular shape that can be wrangled more easily. In this form, some more complex metadata fields that cannot be converted to a rectangular shapre are discarded. If FALSE, returns the records as a list-like gesis_records object. This object is more comprehensive, but harder to work with. Defaults to FALSE.

x

Object of class gesis_records

...

Arguments passed on to the respective S3 methods.

Value

If tidy = FALSE, returns an object of class gesis_records consisting of multiple objects of class gesis_record. Each gesis_record contains attributes index, id, and score specifying the index, the record ID, and the match score.

If tidy = TRUE, returns a dataframe or tibble where each row is a record and each column is a metadata field.

In any case, the query used to retrieve the data is stored in the attribute query.

Examples

# Make a queryless search across the entire database and return
# the first 10 results
gesis_search()
#> A list of <gesis_records> with 10 records
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-10625
#> Title: A importância dos festivais na formação do artista
#> Date: 2000
#> Person:
#>  Strazzacappa Hernández, Márcia Maria
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-10636
#> Title: Sobre a especificidade do objeto da história da educação
#> Date: 2000
#> Person:
#>  Saviani, Dermeval
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-10674
#> Title: The Burden of Pseudo-Existing Choice
#> Date: 2009
#> Person:
#>  Levada, Yuri
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-18650
#> Title: Einleitung
#> Date: 2006
#> Persons:
#>  Becker, Heinrich
#>  Brauer, Kai
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-18669
#> Title: Die "andere" Seite instrumentellen Handelns
#> Date: 2006
#> Person:
#>  Böhle, Fritz
#> # ℹ 5 more records
#> # ℹ Use `print(n = ...)` to see more records

# Queries can be narrowed down by providing a query string
record <- gesis_search("climate change")

# gesis_search() searches for all types of records by default. If you only
# want to search for, say, datasets, you can set the `type` argument.
gesis_search(type = "research_data")
#> A list of <gesis_records> with 10 records
#> <gesis_record>
#> Type: research_data
#> ID: ZA0315
#> Title: IOS-Akademie
#> Date: 1968
#> Persons:
#>  Sommer, Klaus
#>  Stegemann, Hagen
#> 
#> <gesis_record>
#> Type: research_data
#> ID: ZA0340
#> Title: Olivetti-Vertreter (Fluktuation 1961)
#> Date: 1961
#> Person:
#>  DIVO, Frankfurt
#> 
#> <gesis_record>
#> Type: research_data
#> ID: ZA0343
#> Title: Firmenbild "Waschmittelindustrie"
#> Date: 1960
#> Person:
#>  DIVO, Frankfurt
#> 
#> <gesis_record>
#> Type: research_data
#> ID: ZA0344
#> Title: Beschäftigte in der Bauwirtschaft
#> Date: 1960
#> Person:
#>  DIVO, Frankfurt
#> 
#> <gesis_record>
#> Type: research_data
#> ID: ZA0360
#> Title: Probleme mittelständischer Unternehmer
#> Date: 1964
#> Persons:
#>  Daheim, Hans-Jürgen
#>  Kaupen, Wolfgang
#> # ℹ 5 more records
#> # ℹ Use `print(n = ...)` to see more records

# By default, only 10 results (1 page) are returned. You can specify
# which pages should queried or if all should be returned
gesis_search("climate change", pages = 2:3) # pages 2 and 3
#> A list of <gesis_records> with 20 records
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-45173
#> Title: Can climate change negotiations succeed?
#> Date: 2013
#> Persons:
#>  Hovi, Jon
#>  Skodvin, Tora
#>  Aakre, Stine
#> 
#> <gesis_record>
#> Type: publication
#> ID: bibsonomy-flachsland2021germanys
#> Title: Germany’s Federal Climate Change Act
#> Date: 2021
#> Persons:
#>  Flachsland, Christian
#>  Levi, Sebastian
#> 
#> <gesis_record>
#> Type: gesis_bib
#> ID: gesis-bib-126747
#> Title: Climate change and cultural diversity
#> Person:
#>  Wisner, Ben
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-79316
#> Title: Germany's Federal Climate Change Act
#> Date: 2021
#> Persons:
#>  Flachsland, Christian
#>  Levi, Sebastian
#> 
#> <gesis_record>
#> Type: publication
#> ID: bibsonomy-evansa2013climate
#> Title: Climate of Doubt: What Australians Think About Climate Change
#> Date: 2013
#> Persons:
#>  Evans, A.
#>  Reimondos, A.
#> # ℹ 15 more records
#> # ℹ Use `print(n = ...)` to see more records
if (FALSE) gesis_search("climate change", pages = NULL) # all pages

# By default, results are wrapped in a complex list structure. This is
# good for representing detailed information, but not for analyzing data.
# Results can be tidied up to a dataframe using either `as_tibble()`
# or by setting the `tidy` argument to TRUE
tibble::as_tibble(record)
#> # A tibble: 10 × 50
#>    id            title type  date  date_recency abstract portal_url topic person
#>    <chr>         <chr> <chr> <chr> <chr>        <chr>    <chr>      <lis> <list>
#>  1 csa-pais-201… Migr… publ… 2011  2011         "Provid… http://so… <chr> <chr> 
#>  2 gesis-ssoar-… Japa… publ… 2021  2021         "This a… https://w… <chr> <chr> 
#>  3 gesis-bib-14… The … gesi… NA    NA            NA      NA         <chr> <chr> 
#>  4 fes-bib-4691… Huma… publ… 2009  2009          NA      http://so… <chr> <chr> 
#>  5 gesis-bib-14… Futu… gesi… NA    NA            NA      NA         <chr> <chr> 
#>  6 gesis-ssoar-… Atti… publ… 2020  2020         "While … https://w… <chr> <chr> 
#>  7 bibsonomy-go… Clim… publ… 2008  2008         ""       NA         <chr> <chr> 
#>  8 gesis-bib-13… Intr… gesi… NA    NA            NA      NA         <chr> <chr> 
#>  9 gesis-bib-15… Clim… gesi… 2019  2019          NA      NA         <chr> <chr> 
#> 10 gesis-bib-15… Clim… publ… 2019  2019          NA      NA         <chr> <chr> 
#> # ℹ 41 more variables: person_sort <chr>, source <chr>, subtype <chr>,
#> #   publisher <chr>, database <chr>, document_type <chr>, coreAuthor <list>,
#> #   corePublisher <chr>, coreIsbn <chr>, coredoctypelitadd <chr>,
#> #   coreLanguage <chr>, data_source <chr>, link_count <chr>, gesis_own <int>,
#> #   fulltext <chr>, index_source <chr>, literature_collection <chr>,
#> #   coreSjahr <chr>, coreJournalTitle <chr>, coreZsband <chr>,
#> #   coreZsnummer <chr>, doi <chr>, coreIssn <chr>, metadata_quality <chr>, …
gesis_search("climate change", tidy = TRUE)
#> # A tibble: 10 × 50
#>    id            title type  date  date_recency abstract portal_url topic person
#>    <chr>         <chr> <chr> <chr> <chr>        <chr>    <chr>      <lis> <list>
#>  1 csa-pais-201… Migr… publ… 2011  2011         "Provid… http://so… <chr> <chr> 
#>  2 gesis-ssoar-… Japa… publ… 2021  2021         "This a… https://w… <chr> <chr> 
#>  3 gesis-bib-14… The … gesi… NA    NA            NA      NA         <chr> <chr> 
#>  4 fes-bib-4691… Huma… publ… 2009  2009          NA      http://so… <chr> <chr> 
#>  5 gesis-bib-14… Futu… gesi… NA    NA            NA      NA         <chr> <chr> 
#>  6 gesis-ssoar-… Atti… publ… 2020  2020         "While … https://w… <chr> <chr> 
#>  7 bibsonomy-go… Clim… publ… 2008  2008         ""       NA         <chr> <chr> 
#>  8 gesis-bib-13… Intr… gesi… NA    NA            NA      NA         <chr> <chr> 
#>  9 gesis-bib-15… Clim… gesi… 2019  2019          NA      NA         <chr> <chr> 
#> 10 gesis-bib-15… Clim… publ… 2019  2019          NA      NA         <chr> <chr> 
#> # ℹ 41 more variables: person_sort <chr>, source <chr>, subtype <chr>,
#> #   publisher <chr>, database <chr>, document_type <chr>, coreAuthor <list>,
#> #   corePublisher <chr>, coreIsbn <chr>, coredoctypelitadd <chr>,
#> #   coreLanguage <chr>, data_source <chr>, link_count <chr>, gesis_own <int>,
#> #   fulltext <chr>, index_source <chr>, literature_collection <chr>,
#> #   coreSjahr <chr>, coreJournalTitle <chr>, coreZsband <chr>,
#> #   coreZsnummer <chr>, doi <chr>, coreIssn <chr>, metadata_quality <chr>, …

# Using the fields argument you can control how different text fields
# are weighted in matching the query string.
# Search for "climate change" only in texts, not in other fields
gesis_search("climate change", fields = field_weights(
  full_text = 10,
  abstract_en = 5,
  abstract = 3
))
#> A list of <gesis_records> with 10 records
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-22412
#> Title: Does tomorrow ever come? Disaster narrative and public perceptions of
#> climate change
#> Date: 2006
#> Persons:
#>  Lowe, Thomas
#>  Brown, Katrina
#>  Dessai, Suraje
#>  de França Doria, Miguel
#>  Haynes, Kat
#>  ... and 1 more
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-43950
#> Title: Can affluence explain public attitudes towards climate change mitigation
#> policies? A multilevel analysis with data from 27 EU countries
#> Date: 2014
#> Person:
#>  Sasko, David
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-22420
#> Title: Ideological cultures and media discourses on scientific knowledge:
#> re-reading news on climate change
#> Date: 2007
#> Person:
#>  Carvalho, Anabela
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-63976
#> Title: From climate migration to anthropocene mobilities: shifting the debate
#> Date: 2019
#> Persons:
#>  Baldwin, Andrew
#>  Fröhlich, Christiane
#>  Rothe, Delf
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-39185
#> Title: Green governance - one solution for two problems? Climate change and
#> economic shocks ; risk perceptions and coping strategies in China, India and
#> Bangladesh
#> Date: 2010
#> Persons:
#>  Senz, Anja
#>  Reinhardt, Dieter
#> # ℹ 5 more records
#> # ℹ Use `print(n = ...)` to see more records

# Search for articles in a specified journal
gesis_search("urban planning", fields = field_weights(coreJournalTitle = 10))
#> A list of <gesis_records> with 10 records
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-54205
#> Title: Designing Difference: Co-Production of Spaces of Potentiality
#> Date: 2016
#> Persons:
#>  Wolf, Garrett
#>  Mahaffey, Nathan
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-54236
#> Title: Planning for Planet or City?
#> Date: 2016
#> Person:
#>  Davidson, Mark
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-54297
#> Title: Characterizing New Channels of Communication: A Case Study of Municipal
#> 311 Requests in Edmonton, Canada
#> Date: 2016
#> Persons:
#>  Lu, Qing
#>  Johnson, Peter A.
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-54306
#> Title: Planning with Citizens: Implementation of an e-Planning Platform and
#> Analysis of Research Needs
#> Date: 2016
#> Persons:
#>  Steiniger, Stefan
#>  Poorazizi, M. Ebrahim
#>  Hunter, Andrew J. S.
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-54386
#> Title: Data-Driven Participation: Algorithms, Cities, Citizens, and Corporate
#> Control
#> Date: 2016
#> Persons:
#>  Tenney, Matthew
#>  Sieber, Renee
#> # ℹ 5 more records
#> # ℹ Use `print(n = ...)` to see more records

# Search strings are separated by an AND operator by default
# this default can be overwritten by setting default_operator = "OR"
# or by manually separating the query string
weight <- field_weights(title = 100)
and <- gesis_search(
  "climate change",
  sort = "title_ascending",
  fields = weight
)
or1 <- gesis_search(
  "climate OR change",
  sort = "title_ascending",
  fields = weight
)
or2 <- gesis_search(
  "climate change",
  sort = "title_ascending",
  default_operator = "OR",
  fields = weight
)
attr(and, "query") <- NULL
attr(or1, "query") <- NULL
attr(or2, "query") <- NULL
identical(and, or1)
#> [1] FALSE
identical(or1, or2)
#> [1] TRUE

# Similarly, you can construct complex query terms using operators
gesis_search("(climate or environmental) AND (change OR crisis OR action)")
#> A list of <gesis_records> with 10 records
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-95723
#> Title: Environmental awareness: The case of climate change
#> Date: 2018
#> Persons:
#>  Weber, Shlomo
#>  Wiesmeth, Hans
#> 
#> <gesis_record>
#> Type: publication
#> ID: bibsonomy-hoffmann2022climate
#> Title: Climate change experiences raise environmental concerns and promote
#> Green voting
#> Date: 2022
#> Persons:
#>  Hoffmann, Roman
#>  Muttarak, Raya
#>  Peisker, Jonas
#>  Stanig, Piero
#> 
#> <gesis_record>
#> Type: publication
#> ID: gesis-ssoar-78644
#> Title: Urban Commons and Collective Action to Address Climate Change
#> Date: 2022
#> Persons:
#>  Colding, Johan
#>  Barthel, Stephan
#>  Ljung, Robert
#>  Eriksson, Felix
#>  Sjöberg, Stefan
#> 
#> <gesis_record>
#> Type: publication
#> ID: bibsonomy-tranterbruce2011political
#> Title: Political divisions over climate change and environmental issues in
#> Australia
#> Date: 2011
#> Person:
#>  Tranter, Bruce
#> 
#> <gesis_record>
#> Type: publication
#> ID: bibsonomy-smith2017public
#> Title: Public Attitudes towards Climate Change and Other Environmental Issues
#> Across Countries
#> Date: 2017
#> Persons:
#>  Smith, Tom W.
#>  Kim, Jibum
#>  Son, Jaesok
#> # ℹ 5 more records
#> # ℹ Use `print(n = ...)` to see more records

# Another way to narrow down the search is to set filters. GESIS Search
# offers a number of filters, including topic, publication year or
# methodology. Sensible values can be checked on https://search.gesis.org/.
gesis_search(topics = "climate change", type = "publication")
#> A list of <gesis_records> with 0 records