Jump to content

Topic on Help talk:Extension:WikibaseCirrusSearch

haswbstatement not working for me. What to check?

3
Clausekwis (talkcontribs)

We have a wikibase installation with several thousand items.

I have checked that CirrusSearch and WikibaseCirrusSearch are both enabled and that $wgWBCSUseCirrus = true; is set.

While inlabel: works fine for me, haswbstatement: doesn't give me any results. Not even using haswbstatement:*.

I checked the elasticsearch query using cirrusDumpQuery and I can see that it gets created properly, yet this does not return anything.

"should": [{ "match": { "statement_keywords.property": { "query": "P1" } } } ]


Furthermore, I have found that these work:

  • hasdescription:fr
  • haslabel:fr
  • inlabel:Metz


And these do not:

  • haswbstatement:*
  • wbstatementquantity:P1=Q17<2


I suppose the next step would be checking the configuration of my elasticsearch index. Any advice on what to look for?

Clausekwis (talkcontribs)

I have started looking at the the various queries, and then at the documents as they are being indexed. And I can see that none of my documents actually have values in the statement_keywords field that is used by the haswbstatement query:

E.g.

"descriptions" : { "en-gb" : "A record with all possible information filled in." }, "statement_keywords" : [ ], "statement_count" : 32, …

Clausekwis (talkcontribs)

Turns out, the wikibase docker set-up is missing the required configuration parameters to actually index statements/properties.

Here's what I have added to our LocalSettings.php:

// For WikibaseCirrusSearch, see

// https://github.com/wikimedia/mediawiki-extensions-WikibaseCirrusSearch/blob/REL1_39/src/Fields/StatementsField.php

// Changing this requires `make setup-elastic` to recreate the mapping and re-index all data

$wgWBRepoSettings['searchIndexProperties'] = [ 'P1', 'P19', 'P23', ];

$wgWBRepoSettings['searchIndexTypes'] = [

'string', 'external-id', 'url', 'wikibase-item', 'wikibase-property',

'wikibase-lexeme', 'wikibase-form', 'wikibase-sense'

];


Of course, you'll need to adapt the property IDs to the ones you need/want to be indexed.

Reply to "haswbstatement not working for me. What to check?"