Click or drag to resize

SearchGenerator Class

This is preliminary documentation and is subject to change.

Search for the pages matching the specific keywords in titles and text. (mw:API:Search, MediaWiki 1.11+)
Inheritance Hierarchy

Namespace: WikiClientLibrary.Generators
Assembly: WikiClientLibrary (in WikiClientLibrary.dll) Version: 0.9.0-int.2+447d1d590e6726b7881f750a0a0e42908f3e417e
Syntax
public class SearchGenerator : WikiPageGenerator<SearchResultItem>

The SearchGenerator type exposes the following members.

Constructors
 NameDescription
Public methodSearchGenerator(WikiSite)Initializes a new instance of the SearchGenerator class
Public methodSearchGenerator(WikiSite, String)Initializes a new instance of the SearchGenerator class
Top
Properties
 NameDescription
Public propertyBackendName Class name of search back-end to use (Default: $wgSearchType, MediaWiki 1.22+)
Public propertyCompatibilityOptions Gets/sets the compatibility options used with this list.
(Inherited from WikiListT)
Protected propertyDistinctGeneratedPages When using the default implementation of EnumPagesAsync(IWikiPageQueryProvider), determines whether to remove duplicate page results generated from generator results. This property does not affect the behavior of EnumItemsAsync(CancellationToken).
(Overrides WikiPageGeneratorTItemDistinctGeneratedPages)
Public propertyGeneratorName The name of generator, used as the value of generator parameter in action=query request.
(Inherited from WikiPageGeneratorTItem)
Public propertyIncludesInterwiki Include interwiki results in the search, if available. (Default: false, MediaWiki 1.23+)
Public propertyKeyword Search for all page titles (or content) that have this value.
Public propertyListName The name of list, used as the value of list parameter in action=query request.
(Overrides WikiListTListName)
Public propertyMatchingField Search inside the text or titles.
Public propertyNamespaceIds Only list pages in these namespaces.
Public propertyPaginationSize Gets/sets maximum items returned per MediaWiki API invocation.
(Inherited from WikiListT)
Public propertySiteGets the MediaWiki site this instance applies to.
(Inherited from WikiListT)
Top
Methods
 NameDescription
Public methodEnumGeneratorParameters Fills generator parameters for action=query&generator= request.
(Inherited from WikiPageGeneratorTItem)
Public methodEnumItemsAsync Asynchronously enumerates all the items in the list.
(Inherited from WikiListT)
Public methodEnumListParameters When overridden, fills generator parameters for action=query&list={ListName} request.
(Overrides WikiListTEnumListParameters)
Public methodEnumPagesAsync Asynchronously generates the sequence of pages.
(Inherited from WikiPageGeneratorTItem)
Public methodEnumPagesAsync(IWikiPageQueryProvider) Asynchronously generates the sequence of pages.
(Inherited from WikiPageGeneratorTItem)
Public methodEnumPagesAsync(PageQueryOptions) Asynchronously generates the sequence of pages.
(Inherited from WikiPageGeneratorTItem)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodItemFromJson Parses an item contained in the action=query&list= JSON response.
(Overrides WikiListTItemFromJson(JsonNode))
Protected methodItemsFromResponse From the given MediaWiki API response of the MediaWiki list request, locates the array of items whose items will be processed by ItemFromJson(JsonNode).
(Inherited from WikiListT)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Protected methodOnEnumItemsFailed When overriden, called when there is exception raised when executing the asynchronous generator function inside EnumItemsAsync(CancellationToken).
(Inherited from WikiListT)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Remarks

Depending on the real-time changes happening on the server, the enumerated sequence from EnumItemsAsync(CancellationToken) may duplicate between each pagination, usually the first and/or the last 1 or 2 items. The result of EnumPagesAsync, however, has already been removed of duplicates.

For full-text search on Wikia, use LocalWikiSearchList.

See Also