This variable is set to null in the replacePrefixes method, document
it as such to prevent errors in consuming code.
Bug: T98082
Change-Id: I78880ffe590ed7193b8482c0ae41c8c69e495878
SearchEngine grows a method to list valid sort orders one to set the
sort for the next search, and one to read it. The default implemenation
only supports 'relevance' and the documenation strongly urges that all
other implemenations leave that as the default. Other implementations
can support other orders. Cirrus already supports title_asc and title_desc.
Change-Id: Ie946150c6796139201221dfa6f7750c210e97166
There's really no reason for the extension to exist separately from
core, and merging it reduces the risks of bitrot in both the extension
(lots of deprecated functions there) and core (missing integration with
PageImages and TextExtracts, for example).
Change-Id: Ie0ab90902ede9499879402290006466efba479e9
This hook is poorly thought out. The only extension that uses it
can't possibly think it works how they're expecting.
Change-Id: I853a01afc8e922f22e949321a2f2343d264632a6
- Move filter() function and make it protected, nothing uses it
outside database-backed searching
- Use per-backend legal search characters rather than assuming the
static implementation is right
Change-Id: Ic2b830b56137b2dfe68b9b9c3de012151e716952
Only worked for Postgres, and only worked halfway at that. Result
sets could be false for many reasons. No results, bad query, database
went to Mars. We shouldn't assume they're always "too many results."
Leave it up to the normal query error logging and move on.
Change-Id: Ieddd163e440ae54b152541d727c1afdbc4ab4fbd
* Checkbox on own row below power search checkboxes per MatmaRex;
avoiding a mw-search-ns* id leaves it untouched by All/None JS.
* The option searcheverything is removed: a "shortcut" which is no
longer necessary now that options can be (un)selected at once
with All/None buttons on search page itself.
* Require a token for saving: no accidental preferences changes.
* Keep the searchoptions/advancedsearchoptions prefs section in case
something is using it (no known extension does though); options
are converted to "api" type so it's empty and hidden by default.
* Add minimal documentation for saveSettings() and friends
(@todo since 155ddf6de, 2009!).
Bug: 52817
Change-Id: I514cee835988600cc013658049e88a10b670e64a
The vast majority of wikis have an empty help namespace and
searching project pages is mostly an advanced search feature.
Cluttering the UI with an extra tab that's (most likely) rarely
clicked isn't helping anyone.
Change-Id: I0c448bcee877e027ff95c96812aac86d89d4eb32
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Change-Id: Ifbb1da2a6278b0bde2a6f6ce2e7bd383ee3fb28a
Always include redirects. Search results are worse without them
and MWSearch has never respected this option anyway.
Change-Id: I0ebe321a3b14e7960aa98e3225dc5a19ba916e7d
None of the following extensions use these parameters:
- CirrusSearch
- MWSearch
- SolrSearch
- SphinxSearch
Change-Id: I9686ca0849f35a3a09bd9996e4c6eac4334a342a
Rather, create a hook that search implementations can override to specify
that the search contained advanced syntax and core will read it in
Special:Search and only offer the link if it is false. It'll default
false.
Change-Id: Ic4ce6361d0e602ed9a812dfbbd15ce11a762f5f8
The class default is 10/0, it doesn't make sense to set that
as 0/0 here. Nor does it make sense to really override it
here at all, as class defaults should take precedent unless
explicitly overriden by callers.
Bug: 60475
Change-Id: I4a48fd3c55908b52c8b0ab081d856874d16b876e
There's a lot in the base search implementations that is specific
to the database backed search. This starts moving some of that out
into a shared base class for those.
For starters, let's not grab a connection to the slave DB for
every single search for backends unless they need it.
Change-Id: Ib66696841eea901e04b21dd309784af889a45ab1
- Make variables protected. Only class that uses these is LuceneResult
and it's fine
- Don't bother constructing a new file object if we've already got
one in memory (we likely do)
Change-Id: I7973aff1e96297a2fea70392b765c93a8c884d52
Also tell the SearchEngine that we don't *need* the suggestion. Some will
make it any way and we'll ignore it. Cirrus will be able to save some time
by not building the suggestion.
Bug: 59666
Change-Id: Ifd5bafe25a715db9d44cf0fee2ba2607f6c270a2
$wgSearchType needs to be controlled for at time the pages get created.
This patch sets the $wgSearchType global.
Also, the 'singleton' is removed from SearchEngine::getSearchTypes, which
appears to provide little or no benefit while binding all tests to the
global variable.
SearchEngine::getSearchTypes() gets called in SearchUpdate which is
run on page edits. This means the first page edit in the entire
test suite causes the global variable to be set and subsequent tests
cannot override it.
These changes allow SearchEngineTest to pass, even if one has CirrusSearch
or other such extensions enabled.
Change-Id: I39050da8659dc69db31125f469f494a5fb4b8fca
Use the srbackend parameter if it's valid.
If it's not, use $wgSearchType if it's not null.
Finally, fall back to the search type of the database.
Bug: 53982
Change-Id: I3605cb4add270543aa20afb037401b2dfbe462f0
$wgDisableSearchUpdate is a sledgehammer for disabling all indexing
which is fine for most people, but sometimes you've got multiple
search backends and you want some to update but not others. This
allows each backend to tell core whether they support the feature.
This also removes the SearchUpdate hook which really doesn't make
sense and nobody uses but CirrusSearch and an abandoned extension
from 7 years ago.
Will require parallel change to MWSearch (Ibd002347) and Cirrus (I87a5b8cc)
Change-Id: I2063fe05000044225fa6bec2171ed0071b84a5cf
This is useful when you're doing testing of multiple search
engines and you want to compare results.
Note that it doesn't do anything for the prefix search which is ok!
Change-Id: I96a08c64ac84e93b0bec2e8b08d8943b775e68d1
Going to use this in CirrusSearch since the default text
handling is insane for Solr.
While we're at it, further move content handling to SearchEngine
so children can override behavior here.
Change-Id: I09d11b81c224d53609c57d75d54021e697b56629
This is still less than ideal, but at least consolidates the
logic so we can later implement more content-specific handling.
Change-Id: Ic24a7ea2818f6eeb67453877dc5a31f110541ecf
Right now, if you delete a page then you end up with a stale
entry in the search index, this affects all core SQL-based
searches.
For extensions, this means they no longer have to implement
something like ArticleDelete, they can just add the delete()
method to their SearchEngine subclass.
Change-Id: I9d8a9878aeebc53f453ab1cbacc03fe73fcca949
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments
Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
Before the introduction of the content handler, missing content was
signified by getText() returning null instead of a string. null will
work much like an empty string in most contexts, so in many places,
it was not checked explcitely whether the conent was null.
Now, when getContent() returns null, this often caused a fatal error,
because the code would access whatever getContent() returned as an object,
without checking whether it was null (because no such check was performed
previously, when the content was represented as a string).
This check introduces explicite checks for getContent() returning null
in the most essential core classes.
Change-Id: I551a90b0b67b8edc7570ca5d252ecc1de903f097
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
code.
* various undocumented function parameters
* typos in parameters declarations
Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421