| [ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Source view] [Print] [Project Stats]
Basic search engine This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
| File Size: | 555 lines (14 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
SearchEngine:: (27 methods):
searchText()
searchTitle()
supports()
setFeatureData()
normalizeText()
transformSearchTerm()
getNearMatch()
getNearMatchResultSet()
getNearMatchInternal()
legalSearchChars()
setLimitOffset()
setNamespaces()
setShowSuggestion()
replacePrefixes()
searchableNamespaces()
userNamespaces()
userHighlightPrefs()
defaultNamespaces()
namespacesAsText()
create()
getSearchTypes()
update()
updateTitle()
delete()
getOpenSearchTemplate()
getTextFromContent()
textAlreadyUpdatedForIndex()
SearchEngineDummy:: (0 methods):
Class: SearchEngine - X-Ref
Contain a class for special pages| searchText( $term ) X-Ref |
| Perform a full text search query and return a result set. If title searches are not supported or disabled, return null. STUB param: string $term Raw search term return: SearchResultSet|Status|null |
| searchTitle( $term ) X-Ref |
| Perform a title-only search query and return a result set. If title searches are not supported or disabled, return null. STUB param: string $term Raw search term return: SearchResultSet|null |
| supports( $feature ) X-Ref |
param: string $feature return: bool |
| setFeatureData( $feature, $data ) X-Ref |
| Way to pass custom data for engines param: string $feature param: mixed $data return: bool |
| normalizeText( $string ) X-Ref |
| When overridden in derived class, performs database-specific conversions on text to be used for searching or updating search index. Default implementation does nothing (simply returns $string). param: string $string String to process return: string |
| transformSearchTerm( $term ) X-Ref |
| Transform search term in cases when parts of the query came as different GET params (when supported), e.g. for prefix queries: search=test&prefix=Main_Page/Archive -> test prefix:Main Page/Archive param: string $term return: string |
| getNearMatch( $searchterm ) X-Ref |
| If an exact title match can be found, or a very slightly close match, return the title. If no match, returns NULL. param: string $searchterm return: Title |
| getNearMatchResultSet( $searchterm ) X-Ref |
| Do a near match (see SearchEngine::getNearMatch) and wrap it into a SearchResultSet. param: string $searchterm return: SearchResultSet |
| getNearMatchInternal( $searchterm ) X-Ref |
| Really find the title match. param: string $searchterm return: null|Title |
| legalSearchChars() X-Ref |
| No description |
| setLimitOffset( $limit, $offset = 0 ) X-Ref |
| Set the maximum number of results to return and how many to skip before returning the first. param: int $limit param: int $offset |
| setNamespaces( $namespaces ) X-Ref |
| Set which namespaces the search should include. Give an array of namespace index numbers. param: array $namespaces |
| setShowSuggestion( $showSuggestion ) X-Ref |
| Set whether the searcher should try to build a suggestion. Note: some searchers don't support building a suggestion in the first place and others don't respect this flag. param: bool $showSuggestion Should the searcher try to build suggestions |
| replacePrefixes( $query ) X-Ref |
| Parse some common prefixes: all (search everything) or namespace names param: string $query return: string |
| searchableNamespaces() X-Ref |
| Make a list of searchable namespaces and their canonical names. return: array |
| userNamespaces( $user ) X-Ref |
| Extract default namespaces to search from the given user's settings, returning a list of index numbers. param: user $user return: array |
| userHighlightPrefs() X-Ref |
| Find snippet highlight settings for all users return: array Contextlines, contextchars |
| defaultNamespaces() X-Ref |
| An array of namespaces indexes to be searched by default return: array |
| namespacesAsText( $namespaces ) X-Ref |
| Get a list of namespace names useful for showing in tooltips and preferences param: array $namespaces return: array |
| create( $type = null ) X-Ref |
| Load up the appropriate search engine class for the currently active database backend, and return a configured instance. param: string $type Type of search backend, if not the default return: SearchEngine |
| getSearchTypes() X-Ref |
| Return the search engines we support. If only $wgSearchType is set, it'll be an array of just that one item. return: array |
| update( $id, $title, $text ) X-Ref |
| Create or update the search index record for the given page. Title and text should be pre-processed. STUB param: int $id param: string $title param: string $text |
| updateTitle( $id, $title ) X-Ref |
| Update a search index record's title only. Title should be pre-processed. STUB param: int $id param: string $title |
| delete( $id, $title ) X-Ref |
| Delete an indexed page Title should be pre-processed. STUB param: int $id Page id that was deleted param: string $title Title of page that was deleted |
| getOpenSearchTemplate() X-Ref |
| Get OpenSearch suggestion template return: string |
| getTextFromContent( Title $t, Content $c = null ) X-Ref |
| Get the raw text for updating the index from a content object Nicer search backends could possibly do something cooler than just returning raw text param: Title $t Title we're indexing param: Content $c Content of the page to index return: string |
| textAlreadyUpdatedForIndex() X-Ref |
| If an implementation of SearchEngine handles all of its own text processing in getTextFromContent() and doesn't require SearchUpdate::updateText()'s rather silly handling, it should return true here instead. return: bool |
Class: SearchEngineDummy - X-Ref
Dummy class to be used when non-supported Database engine is present.| Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |