Learn R Programming

wikiTools (version 1.2.8)

m_Opensearch: Open search of a string

Description

Search string in the content of the project page using OpenSearch. Only in namespace 0. Please, see https://www.mediawiki.org/wiki/API:Opensearch for further information.

Usage

m_Opensearch(
  string,
  project = "en.wikipedia.org",
  profile = "engine_autoselect",
  redirects = "resolve"
)

Value

A data-frame of page titles and URL returned. If error, return Null.

Arguments

string

String to search.

project

Wikimedia project, defaults "en.wikipedio.org".

profile

This parameter sets the search type: classic, engine_autoselect (default), fast-fuzzy, fuzzy, fuzzy-subphrases, normal, normal-subphrases, and strict.

redirects

If redirects='return', the page title is the normalized one (also the URL). If redirects='resolve", the page title is the normalized and resolved redirection is in effect (also the URL). Note that in both cases the API performs a NFC Unicode normalization on search string.

Author

Angel Zazo, Department of Computer Science and Automatics, University of Salamanca

Examples

Run this code
# Some search profiles:
df <- m_Opensearch(string='Duque de Alba', project='es.wikipedia.org',
                    profile="engine_autoselect", redirects="resolve")
df <- m_Opensearch(string='Duque de Alba', project='es.wikipedia.org', profile="strict")
df <- m_Opensearch(string='Duque de Alba', project='es.wikipedia.org', profile="fuzzy")

Run the code above in your browser using DataLab