Nextcloud PHP API (stable19)

ISearchRequest

Interface ISearchRequest

When a search request is initiated, from a request from the front-end or using the IFullTextSearchManager::search() method, FullTextSearch will create a SearchRequest object, based on this interface.

The object will be passed to the targeted Content Provider so it can convert search options using available method.

The object is then encapsulated in a SearchResult and send to the Search Platform.

Tags
since
15.0.0

Table of Contents

addField()  : ISearchRequest
Add an extra field to the search.
addLimitField()  : ISearchRequest
Limit the search to a specific field of the mapping, using a full string.
addMetaTag()  : ISearchRequest
Limit the search to a specific meta tag.
addPart()  : ISearchRequest
Limit the search to a part of the document.
addRegexFilters()  : ISearchRequest
Filter the results, based on a group of field, using regex
addSearch()  : ISearchRequest
Extends the searched string.
addSimpleQuery()  : ISearchRequest
Add a MUST search on an extra field
addSubTag()  : ISearchRequest
Limit the search to a specific sub tag.
addWildcardField()  : ISearchRequest
Limit the search to a specific field of the mapping, using a wildcard on the search string.
addWildcardFilter()  : ISearchRequest
Filter the results, based on a group of field, using wildcard
getAuthor()  : string
Get the author of the request.
getFields()  : array
Get the list of extra field to search into.
getLimitFields()  : array
Get the fields the search is limited to.
getMetaTags()  : array
Get the meta tags the search is limited to.
getOption()  : string
Get the value of an option (as string).
getOptionArray()  : array
Get the value of an option (as array).
getPage()  : int
Get the current page.
getParts()  : array
Get the parts the search is limited to.
getRegexFilters()  : array
Get the regex filters the search is limit to.
getSearch()  : string
Get the searched string.
getSimpleQueries()  : \OCP\FullTextSearch\Model\ISearchRequestSimpleQuery[]
Get the list of queries on extra field.
getSize()  : int
Get the maximum number of results to be returns by the Search Platform.
getSubTags()  : array
Get the sub tags the search is limited to.
getWildcardFields()  : array
Get the limit to field of the mapping.
getWildcardFilters()  : array
Get the wildcard filters the search is limit to.
setMetaTags()  : ISearchRequest
Limit the search to an array of meta tags.
setParts()  : ISearchRequest
Limit the search to an array of parts of the document.
setSearch()  : ISearchRequest
Set the searched string.
setSubTags()  : ISearchRequest
Limit the search to an array of sub tags.

Methods

addLimitField()

Limit the search to a specific field of the mapping, using a full string.

public addLimitField(string $field) : ISearchRequest
Parameters
$field : string
Tags
since
15.0.0
Return values
ISearchRequest

addRegexFilters()

Filter the results, based on a group of field, using regex

public addRegexFilters(array $filters) : ISearchRequest
Parameters
$filters : array
Tags
since
15.0.0
Return values
ISearchRequest

addSubTag()

Limit the search to a specific sub tag.

public addSubTag(string $source, string $tag) : ISearchRequest
Parameters
$source : string
$tag : string
Tags
since
15.0.0
Return values
ISearchRequest

addWildcardField()

Limit the search to a specific field of the mapping, using a wildcard on the search string.

public addWildcardField(string $field) : ISearchRequest
Parameters
$field : string
Tags
since
15.0.0
Return values
ISearchRequest

addWildcardFilter()

Filter the results, based on a group of field, using wildcard

public addWildcardFilter(array $filter) : ISearchRequest
Parameters
$filter : array
Tags
since
15.0.0
Return values
ISearchRequest

getAuthor()

Get the author of the request.

public getAuthor() : string
Tags
since
15.0.0
Return values
string

getFields()

Get the list of extra field to search into.

public getFields() : array
Tags
since
15.0.0
Return values
array

getLimitFields()

Get the fields the search is limited to.

public getLimitFields() : array
Tags
since
15.0.0
Return values
array

getMetaTags()

Get the meta tags the search is limited to.

public getMetaTags() : array
Tags
since
15.0.0
Return values
array

getOption()

Get the value of an option (as string).

public getOption(string $option[, string $default = '' ]) : string
Parameters
$option : string
$default : string = ''
Tags
since
15.0.0
Return values
string

getOptionArray()

Get the value of an option (as array).

public getOptionArray(string $option[, array $default = [] ]) : array
Parameters
$option : string
$default : array = []
Tags
since
15.0.0
Return values
array

getPage()

Get the current page.

public getPage() : int

Used by pagination.

Tags
since
15.0.0
Return values
int

getParts()

Get the parts the search is limited to.

public getParts() : array
Tags
since
15.0.0
Return values
array

getRegexFilters()

Get the regex filters the search is limit to.

public getRegexFilters() : array
Tags
since
15.0.0
Return values
array

getSearch()

Get the searched string.

public getSearch() : string
Tags
since
15.0.0
Return values
string

getSimpleQueries()

Get the list of queries on extra field.

public getSimpleQueries() : \OCP\FullTextSearch\Model\ISearchRequestSimpleQuery[]
Tags
since
17.0.0
Return values
\OCP\FullTextSearch\Model\ISearchRequestSimpleQuery[]

getSize()

Get the maximum number of results to be returns by the Search Platform.

public getSize() : int
Tags
since
15.0.0
Return values
int

getSubTags()

Get the sub tags the search is limited to.

public getSubTags(bool $formatted) : array
Parameters
$formatted : bool
Tags
since
15.0.0
Return values
array

getWildcardFields()

Get the limit to field of the mapping.

public getWildcardFields() : array
Tags
since
15.0.0
Return values
array

getWildcardFilters()

Get the wildcard filters the search is limit to.

public getWildcardFilters() : array
Tags
since
15.0.0
Return values
array

Search results