Enable finding forms using wbsearchentities API
Closed, ResolvedPublic

Description

Includes:

WMDE-leszek triaged this task as Normal priority.
Addshore claimed this task.
Restricted Application added a project: User-Addshore. · View Herald TranscriptApr 16 2018, 12:41 PM
Addshore moved this task from Backlog to In Progress on the User-Addshore board.Apr 16 2018, 12:41 PM

Change 426900 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Wikibase@master] Add wbsearchentities example for entity ID search

https://gerrit.wikimedia.org/r/426900

Change 426902 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Wikibase@master] Update wbsearchentities description, it can also search IDs

https://gerrit.wikimedia.org/r/426902

Addshore updated the task description. (Show Details)Apr 16 2018, 12:48 PM

Change 426936 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Wikibase@master] DNM WIP DRAFT Add seperate setting for enabling entity types

https://gerrit.wikimedia.org/r/426936

Change 426900 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add wbsearchentities example for entity ID search

https://gerrit.wikimedia.org/r/426900

Change 426902 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Update wbsearchentities description, it can also search IDs

https://gerrit.wikimedia.org/r/426902

Addshore updated the task description. (Show Details)Apr 17 2018, 3:54 PM

Change 427169 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/WikibaseLexeme@master] WIP define form as a sub entity type of lexeme

https://gerrit.wikimedia.org/r/427169

This patch works for me - though it introduces a subtle link between term helper dispatcher and the API. But otherwise it makes sense - search works for types that have search helpers defined.

iff --git a/repo/Wikibase.php b/repo/Wikibase.php
index 368a6ce..ebca90b 100644
--- a/repo/Wikibase.php
+++ b/repo/Wikibase.php
@@ -223,7 +223,7 @@ call_user_func( function() {
                                $repo->getEntityTitleLookup(),
                                $repo->getPropertyDataTypeLookup(),
                                $repo->getTermsLanguages(),
-                               $repo->getEnabledEntityTypes(),
+                               array_keys( $repo->getEntitySearchHelperCallbacks() ),
                                $repo->getConceptBaseUris()
                        );

Change 427322 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Wikibase@master] Split EntityId SearchHelper From EntitySearchTermIndex

https://gerrit.wikimedia.org/r/427322

Change 426936 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Provide a way to register sub entity types

https://gerrit.wikimedia.org/r/426936

Change 427169 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Define form as a sub entity type of lexeme

https://gerrit.wikimedia.org/r/427169

Change 427367 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/WikibaseLexeme@master] Enabled finding forms using their IDs

https://gerrit.wikimedia.org/r/427367

Change 427322 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Split EntityId SearchHelper From EntitySearchTermIndex

https://gerrit.wikimedia.org/r/427322

Addshore updated the task description. (Show Details)Apr 18 2018, 1:24 PM
Addshore updated the task description. (Show Details)

@Smalyshev: sorry, I failed to leave the comment here yesterday. What you have shown would have worked for the search use case, but @Addshore made a more universal and there should be no more complaints about form not being an entity type. Please report back if there are still issues.

Change 427367 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Enabled finding forms using their IDs

https://gerrit.wikimedia.org/r/427367

WMDE-leszek updated the task description. (Show Details)Apr 24 2018, 2:00 PM

Can I haz testlink? 🐱

WMDE-leszek moved this task from Doing to To Do on the Wikidata-Turtles-Sprint#4 board.

Re documentation of API (description extended and example using Q-ID as a search term added https://www.wikidata.org/w/api.php?action=help&modules=wbsearchentities)