Page MenuHomePhabricator

Add hints parameter to wbsearchentities
Open, LowPublic

Description

In order to allow wbsearchentities to accept more than just one search term, we may want to add additional parameter that would describe how search results may be filtered.

We will also add an argument to EntitySearchHelper API which will allow to restrict or modify results.

Potential use cases:
For Lexeme search:

  • Specify language for Lexeme as Q-id
  • Specify lexical category for Lexeme as Q-id (T195440)
  • Specify grammatical features for Forms as Q-id (T201821)

For Item search:

Event Timeline

Smalyshev triaged this task as Medium priority.May 3 2018, 5:36 PM

Change 430793 had a related patch set uploaded (by Smalyshev; owner: Smalyshev):
[mediawiki/extensions/Wikibase@master] Allow passing arbitrary options to search helper

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

EBernhardson subscribed.

I'm not really sure how to move this forward, moving to waiting/blocked to match reality.

We need to discuss it with Wikidata folks, since this is an infrastructure for some more advanced features but I'm not sure when/if we will do these features. Will raise it on Wed meeting.

@Jonas Would your current way of doing this also be possible for the language, lexical category and grammatical features on Lexeme pages as well as units for quantity values? I'm asking because these are not attached to a property and I'm not sure how that could be done there. Or do we need to go with the hints parameter as suggested in this ticket for those cases?

@Jonas Would your current way of doing this also be possible for the language, lexical category and grammatical features on Lexeme pages as well as units for quantity values? I'm asking because these are not attached to a property and I'm not sure how that could be done there. Or do we need to go with the hints parameter as suggested in this ticket for those cases?

@Lydia_Pintscher please see discussion in T200995: Improve constraint property item suggestions for property constraint values (value type) not sure if we need the hints parameter or if we could just use something like haswbstatement:P31=Unit

It is true that we cannot use the constraints definition as we don't have a property.
The hook that we have introduced could be used.

we could just use something like haswbstatement:P31=Unit

We couldn't use that because keywords are not supported for wbsearchentities. While it is possible they'll be in the future, it's not a near future I think.

we could just use something like haswbstatement:P31=Unit

We couldn't use that because keywords are not supported for wbsearchentities. While it is possible they'll be in the future, it's not a near future I think.

Couldn't we use ?action=query&format=json&list=search&srsearch= ?

Yes, you could use fulltext search, but that would be in a different format that wbsearchentities. If it's ok to move the UI from using wbsearchentities to using fulltext search then it'd work. But note that fulltext search is not a completion search. There's OpenSearch API that is completion search but I'm not sure how well it works with Wikidata now (see T55652).

Smalyshev lowered the priority of this task from Medium to Low.Jun 4 2019, 6:51 AM

Change 430793 abandoned by Addshore:
Allow passing arbitrary options to search helper

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

MPhamWMF subscribed.

Closing out low/est priority tasks over 6 months old with no activity within last 6 months in order to clean out the backlog of tickets we will not be addressing in the near term. Please feel free to reopen if you think a ticket is important, but bare in mind that given current priorities and resourcing, it is unlikely for the Search team to pick up these tasks for the indefinite future. We hope that the requested changes have either been addressed by or made irrelevant by work the team has done or is doing -- e.g. upgrading Elasticsearch to a newer version will solve various ES-related problems -- or will be subsumed by future work in a more generalized way.

thiemowmde subscribed.

Wikidata is not owned by Search. Please try to be more careful.