Extension talk:AdvancedSearch

About this board

Discussion page for technical answers around the Extension AdvancedSearch.

How to set a custom namespace preset as default

3
Summary by Thiemo Kreuz (WMDE)
Krabina (talkcontribs)

I could not find any documentation on how to set a custom made namespace preset as default. I was able to set a custom namespace preset, but "Default" will always be the one checked by default. User have to manually select the new one every time.

Krabina (talkcontribs)

Furthermore, the labeling does not work. I set

$wgAdvancedSearchNamespacePresets = [
        'preset-kma' => [
                'enabled' => true, // indication that this preset should be shown to the user
                'namespaces' => [ '0', '2', '6', '12', '14' ], // list of namespaces to include in this preset
                'label' => 'advancedsearch-namespaces-preset-kma' // id of the translation to use to label the prese>
        ],
];

Which works, but setting the File "MediaWiki:Advancedsearch-namespaces-preset-kma" does not display the label

Thiemo Kreuz (WMDE) (talkcontribs)

I think you are looking for $wgNamespacesToBeSearchedDefault. You probably don't even need a custom preset when you use this instead.

In case you end with two defaults – your new one and the build-in one – add 'defaultNamespaces' => [ 'enabled' => false ], to your $wgAdvancedSearchNamespacePresets configuration to remove the build-in default.

The problem with the label turns out to be an oversight. At the moment only some pre-defined messages can be used. I don't think this limitation is intentional and created phab:T352204 to fix it. Thanks a lot for reporting this!

Reply to "How to set a custom namespace preset as default"

MimeTypeConfigurator.php error on line 49

2
Tompouls (talkcontribs)

Dear,

On a new docker installation MW 1.39.1, PHP 8.1.15, MariaDB 10.10.2, Elastic Search 7.10.2 we get the following error with the AdvancedSearch extension enabled when doing a search:

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in var/www/html/extensions/AdvancedSearch/includes/MimeTypeConfigurator.php on line 49

When AdvancedSearch is disabled, the Elastic Search works properly.

Tom

Thiemo Kreuz (WMDE) (talkcontribs)

This was fixed a few months ago via gerrit:856121. Unfortunately this was not backported to version 1.39. I uploaded gerrit:887354 to do that now.

Reply to "MimeTypeConfigurator.php error on line 49"

What is the dependency on Extension:CirrusSearch?

5
Summary by Peculiar Investor

Dependency now understood. Many of the more advanced capabilities based on categorization, templates used, source text do require CirrusSearch.

Peculiar Investor (talkcontribs)

The enhancement of Special:Search by providing an advanced parameters form and improving how namespaces for a search query are selected seems quite helpful.

My wiki's run on shared hosting plans so using using Extension:CirrusSearch (Elasticsearch) is not possible.

During my initial testing without having Extension:CirrusSearch installed everything still seems to work as expected. So I am left to ask what functionality requires having Extension:CirrusSearch and whether or not this can be installed on wiki's without Extension:CirrusSearch.

Ciencia Al Poder (talkcontribs)

Most of the "advanced" search features work only when using an ElasticSearch backend, like search based on categorization, templates used, source text... Namespace selection is something that should work on the default search.

I don't know if the extension detect the missing CirrusSearch extension and hide those advanced fields automatically, or it blindly assumes "it should work" and the search backend is ignoring them

Peculiar Investor (talkcontribs)

Thank you. I'll investigate that in more detail.

Thiemo Kreuz (WMDE) (talkcontribs)

Unfortunately the extension was developed with Wikimedia wikis in mind where CirrusSearch is available everywhere. Technically it would be possible to make it more flexible and e.g. hide some fields. We are happy to help with tickets and patches, but currently don't have the resources to implement and maintain such a non-Wikimedia mode.

Peculiar Investor (talkcontribs)

Understood. Thank you. It just seems like something that might be helpful on my wiki's and early experiments showed it working without CirrusSearch. As @Ciencia Al Poder mentions further testing has shown most of the "advanced" features do require CirrusSearch.

Advanced search window showing only to logged in users, not anonymous

5
Pspviwki (talkcontribs)

Just recently installed Cirrus (elastic) search, works fantastic, and on top of that installed Advanced search extension too. I found that Advanced search window shows only to logged in users, anonymous users see only 3 dots as if trying to load something. Search works but the Advanced window does not show. Any idea what the root cause might be? Environment: MediaWiki 1.38.2, PHP 7.4.30 (fpm-fcgi), MariaDB 10.8.3-MariaDB, ICU 71.1, LilyPond 2.22.2, Elasticsearch 6.8.23.

Ciencia Al Poder (talkcontribs)

You'll have to open the development console of your browser (hit F12 hey) and look for errors on it.

If you load the URL with the debug=true parameter it should display more detailed information.

Pspviwki (talkcontribs)

Skipped unavailable module ext.advancedSearch.init load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:8

resolveStubbornly @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:8

This page is using the deprecated ResourceLoader module "mediawiki.ui". Special:Search:260 Please use OOUI instead. (anonymous) @ Special:Search:260

Looks strange, wiki is up-to-date.

Ciencia Al Poder (talkcontribs)

"Skipped unavailable module XXXX" usually happens when a new extension is installed, and the page is cached by a frontend cache (varnish, squid, CloudFlare...), which often happens for unregistered users. The page contains the list of available ResourceLoader modules and their metadata (in the RLSTATE variable), but the URL load.php?lang=en&modules=startup&only=scripts contains the dependencies between modules, and it's out of sync.

You'll have to purge the server cache or CloudFlare, or let it clear itself after some time...

Pspviwki (talkcontribs)

Thanks a lot. I purged and it shows correctly for anonymous users as well.

Can you change the default placeholder text?

2
Coyotefather (talkcontribs)

Is there a way to change "cat loves goat" to something else? It's cute and all, but it would be nice to change this to something a little more on-brand.

Bawolff (talkcontribs)

On your wiki, this is controlled by a page named MediaWiki:advancedsearch-placeholder-exact-text you can edit that page to change it.

Reply to "Can you change the default placeholder text?"

Set URL parameter to open advanced pane

3
Pretor~nowiki (talkcontribs)

Hi,

I would like to present a list of search options (standard, advanced, drilldown etc.) and let the users choose. When linking to Advanced Search (Special:Search) is it possible to set a parameter in the URL to have the advanced pane to be open instead of being collapsed?

Thiemo Kreuz (WMDE) (talkcontribs)

This is currently not possibly, sorry. You can create a phab: task so we don't forget about this idea. Personally, I think it's a good one. However, I can't tell if and when it might be implemented as there is currently no active development happening on this extension.

Sokote zaman (talkcontribs)

hello. I agree with that idea.

Reply to "Set URL parameter to open advanced pane"

Question:How can I use AdvancedSearch on mobile?

1
103.196.22.125 (talkcontribs)

I only see it on desktop but mobile

Reply to "Question:How can I use AdvancedSearch on mobile?"

Suggestion: Add ascending order (first to last) as sortable options

4
Summary by 197.235.204.181
197.235.68.39 (talkcontribs)

As a user, I'd like to be able to sort search results by last edited dates by ascending order.

As a user, I'd like to be able to sort page creation dates by ascending order, so that I can read the most recent pages about a topic.

As a user, I'd like to be able to sort page creation dates by ascending order, so that I can view the recent files / images (from the file namespace) matching my interests.


Christoph Jauera (WMDE) (talkcontribs)

Hey and thanks for your question! If you uses the AdvancedSearch interface you already can set the sort order as described. Just chose "Edit date - current on top" or "Creation date - current on top" in the "Sorting order" drop-down in the expanded interface.

197.235.59.131 (talkcontribs)

Well, the current sort is based on last to first, compare descending edits (starting from 13 August 2019 -> 1 October 2012) - www.mediawiki.org/w/index.php?title=Special:Search/monkey&sort=last_edit_desc while www.mediawiki.org/w/index.php?title=Special:Search/monkey&sort=last_edit_asc shows results in the ascending direction (from 12 October 2012 to 13 August 2019 ).

The same applies to creation date. So if the current dropdown options are to be followed, it would need two extra items namely "Edit date - current at bottom" or "Creation date - current at bottom", or something like that.

T0lk (talkcontribs)
Reply to "Suggestion: Add ascending order (first to last) as sortable options"
Blinkingline (talkcontribs)
Product Version
MediaWiki 1.33.0
PHP 7.2.24-0ubuntu0.18.04.1 (fpm-fcgi)
MySQL 5.7.28-0ubuntu0.18.04.4
ICU 60.2
Elasticsearch 6.5.4


AdvancedSearch 0.1.0 (76eea63) 16:40, 25 March 2019 GPL-2.0-or-later Easy access to advanced search capabilities on Special:Search Thiemo Kreuz, Gabriel Birke, Tonina Zhelyazkova, Christoph Jauera, Kai Nissen and Tim Eulitz
CirrusSearch 0.2 (2daa9b8) 09:07, 25 March 2019 GPL-2.0-or-later Elasticsearch-powered search for MediaWiki Nik Everett, Chad Horohoe, Erik Bernhardson and others
Elastica 6.0.2 (eee38b0) 07:37, 10 September 2019 GPL-2.0-or-later Base Elasticsearch functionality for other extensions by providing Elastica library Nik Everett and Chad Horohoe

I'm sure this is something I just haven't configured correctly, but can someone point me to how this should be configured?

I'm trying to search multiple categories with Advanced Search. Using the default setup in CirrusSearch, which appears to be

$wgCirrusSearchCategoryEndpoint = '';

and getting the following message:

$wgCirrusSearchCategoryEndpoint should be set to a valid SPARQL endpoint to use deep category search.


So it makes sense that I'm getting the error, I just don't know what this endpoint should look like.

Any assistance?

Bawolff (talkcontribs)
Blinkingline (talkcontribs)

Right, but I would want this for just within my own wiki.


Bawolff (talkcontribs)
Blinkingline (talkcontribs)

What I don't understand really is why it's using DeepCat at all. What i'm looking for in the instance of THISWORD but not THATWORD in 5 different categories, but none of them are Subcategories....


Seems like a lot of work for something that sounds so simple...I suppose I will look for a workaround, since for such a small wiki, this seems like way more work with not a lot of benefit.


Reply to "Error using deepcat"

Search specific Categories?

1
Revansx (talkcontribs)

Great extension. Thanks!

Please add a feature to allow users to find and select categories to search in the same way that namespaces are selected (as tokens). Thanks! Revansx (talk) 15:20, 24 October 2019 (UTC)

Reply to "Search specific Categories?"