Page MenuHomePhabricator

List number of search results in titles
Open, LowestPublic


There's are example in the bottom of the page: api.php?action=query&list=search&srwhat=text&srsearch=meaning -- It lists "totalhits" for all entries and and "wordcount" for each entry.

Is there a URI to list the hits for "meaning" for each entry like "wordcount"?

Event Timeline

Hi @David_Hedlund, thanks for taking the time to report this! Unfortunately this report lacks some information.

If you have a question how to use the API, please ask on or in a support forum. (Phabricator is for bug reports and feature requests, basically.)

If this is a feature request (asking for functionality that does not exist yet): Please add a more complete description to this report: A clear list of specific steps to reproduce the situation, describing actual results, and describing expected results after performing the steps to reproduce.
You can edit the task description by clicking Edit Task. Thanks!

Title:Text in page

  • Foo: Hello world.
  • Bar: Apples are good
  • Baz: Something in this world that takes you to another world.

URI that lists the word "world":

  • Foo: 1
  • Bar: 0
  • Baz: 2

@Aklapper I tried to describe it better. Do you understand it?

Title:Text in page

  • Foo: Hello world.
  • Bar: Apples are good
  • Baz: Another world, where we all are one.

URI that lists the word "world":

  • Foo: 1
  • Bar: 0
  • Baz: 2

Why is Baz: 2 if "Another world, where we all are one." only includes the word "world" once?
Bar would not be a listed search result anyway, if I understand correctly, as it has 0 matching?

What is the use case? In which situations is it relevant /helpful to know the wordcount in a title?

Again, if your question is "Does XYZ exist?" then that is a support question and out of scope for Phabricator. That seems to be the case here.
If you think that XYZ does not exist then you need to explain why it should exist and rephrase this task to become a feature request. explains how to structure your tasks: Provide steps to reproduce, expected outcome, and actual outcome, in separate sections.

@Aklapper I corrected the example. I think it's an issue if this cannot be listed because it should be possible to count hits in MediaWiki pages. For example curl+jq could be used as a search engine to list them in a terminal.

This works:
search="meaning"; curl "$search" | jq[].title
search="meaning"; curl "$search" | jq[].wordcount

Proposed "jq[].hits" like this:
search="meaning"; curl "$search" | jq[].hits

I also suggest that results should be displayed next to the titles in MediaWiki's search page. I modified a screenshot to give examples, see "Free software (190 results)", "Free and open-sourde software (116 results)", etc, and the example under "Results from sister projects".

Vvjjkkii renamed this task from List number of search results in titles to heaaaaaaaa.Jul 1 2018, 1:02 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
JJMC89 renamed this task from heaaaaaaaa to List number of search results in titles.Jul 1 2018, 3:58 AM
JJMC89 raised the priority of this task from High to Needs Triage.
JJMC89 updated the task description. (Show Details)
Anomie added a subscriber: Anomie.

Implementing this would require that the SearchResult be able to expose this information and the search engine populate it.

EBjune triaged this task as Lowest priority.Jul 5 2018, 5:14 PM
EBjune added a subscriber: EBjune.

We're not sure how this kind of feature would be useful, as frequency already bubbles the most relevant results to the top. Google doesn't even provide this information in results. It's not something we feel we should put the effort into unless there is a huge call for it and we better understand how this feature would be useful.