Page MenuHomePhabricator

Category-only search filter option
Closed, ResolvedPublic

Description

Some users prefer Commons' existing category structure, and I think also feel like this tool is preferencing structured data. While custommatch combines P180 and the category, we should also have an option for just searching the category contents. This would mean querying the Wikidata item for P373, and then using incategory in the Commons query. Essentially, while results are still displayed off Commons, this would allow the tool to be used as a one(?)-click shortcut to see the Commons category results, and also to access the future editor tools as applies to them.

Event Timeline

Dominicbm changed the task status from Open to In Progress.Sep 19 2022, 5:35 PM
Dominicbm assigned this task to SuperHamster.
Dominicbm moved this task from Backlog to In Progress on the View-it! board.

incategory search has been added to the View it! API.

It currently just checks the root category, which means result can be very limited if most things are placed sub-categories.
Examples for hamburgers, custommatch:depicts_or_linked_from vs incategory:
https://view-it.toolforge.org/api/Q6663
https://view-it.toolforge.org/api/Q6663?property=category

Should we include images in sub-categories? My concern is performance and rate limits, but we can maybe include the first X number of first level sub-categories.

incategory search has been added to the View it! API.

It currently just checks the root category, which means result can be very limited if most things are placed sub-categories.
Examples for hamburgers, custommatch:depicts_or_linked_from vs incategory:
https://view-it.toolforge.org/api/Q6663
https://view-it.toolforge.org/api/Q6663?property=category

Should we include images in sub-categories? My concern is performance and rate limits, but we can maybe include the first X number of first level sub-categories.

I assume there is a character limit on search strings, too. In the UI, you run out of characters usually around 3-5 categories. Maybe the simple solution is just to do one additional API call to get the list of subcats (e.g. like this) and add the titles as an in array the API response. In the UI on this type of search, we could show some text at the top that links to search queries for each of the subcat titles. This mimics how categories work on-wiki, as well.

Support for P373 has been added to the UI.

Subcategories have not been integrated yet, but work has been started:

Screen Shot 2022-10-18 at 5.44.32 PM.png (1×1 px, 662 KB)

I am working on design (thinking of placing the categories in an accordion) as well as integrating subcategory search into the UI.

Dominicbm moved this task from In Progress to Done on the View-it! board.