Page MenuHomePhabricator

Integrate Search into Nearby
Closed, DeclinedPublic

Description

The Discovery team has added a geo-search option into CirrusSearch. This will allow our users to request Nearby results that fit a specific search term, which will significantly increase the value of our Nearby screen. (It's also rumored that the new geo-search supports a wider search radius)

The most readily-attainable (and simplest) implementation of this feature in the Android app is the following:

  • In our existing Nearby screen, add a floating Search bar.
  • In the default case (when the search field is empty), the behavior is exactly the same as before.
  • When the user enters text into the search field, re-run the query using the new geo-search API, and display the results from that query.

A couple useful resources to kick this off:

iOS Places
We'd ideally leverage aspects and learnings from the Wikipedia iOS implementation of "Places" for an overall improvement of Nearby:

Event Timeline

Change 303703 had a related patch set uploaded (by Dbrant):
[WIP] Search in Nearby.

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

In the default case (when the search field is empty), the behavior is exactly the same as before.

This can also use the full text query, to get results ordered with more concern towards page popularity as opposed to the old search that used a straight distance calculation. In the initial meeting about this feature there was some concern that the existing nearby search returned plenty of uninteresting pages of buildings simply because they were close. There might be difficulty in choosing the best thresholds for distance though.

Old search: https://en.wikipedia.org/wiki/Special:Nearby#/page/Coit_Tower
Fulltext search: https://en.wikipedia.org/w/index.php?title=Special:Search&search=neartitle%3A5km%2CCoit_Tower

One possible concern here is that for places with lots of pages nearby, such as Coit Tower, you might prefer closer results. For places with nothing nearby, such as Duckwater, Nevada, expanding the search out to maybe even 50km is probably preferred. A combination of a bounding box and and one or more boosts can get you the larger radius but preferring results in the smaller bounds. Unfortunately due to computation constraints we can't do scoring directly on the distance, but multiple boosts can be a reasonable proxy. Using the boost multiple times like this essentially stacks the boosts on top of each other.

old nearby search (no results): https://en.wikipedia.org/wiki/Special:Nearby#/page/Duckwater,_Nevada

full text nearby with 2km, 5km and 20km boosts:
https://en.wikipedia.org/w/index.php?title=Special:Search&search=neartitle%3A%2250km%2CDuckwater%2C+Nevada%22+boost-neartitle%3A%2220km%2CDuckwater%2C+Nevada%22+boost-neartitle%3A%225km%2CDuckwater%2C+Nevada%22+boost-neartitle%3A%222km%2CDuckwater%2C+Nevada%22

in map form:

5km arround Coit Tower: https://people.wikimedia.org/~ebernhardson/mapsearch.html#5km,Coit_Tower|

50km around Coit Tower, with 2km, 5km and 20km boosts: https://people.wikimedia.org/~ebernhardson/mapsearch.html#50km,Coit_Tower|boost-neartitle:2km,Coit_Tower%20boost-neartitle:5km,Coit_Tower%20boost-neartitle:20km,Coit_Tower

5km around Duckwater, Nevada: nothing

50km around Duckwater, Nevada: https://people.wikimedia.org/~ebernhardson/mapsearch.html#50km,Duckwater,_Nevada|

50km around Duckwater, Nevada with 2km, 5km and 20km boosts: https://people.wikimedia.org/~ebernhardson/mapsearch.html#50km,Duckwater,_Nevada|boost-neartitle:2km,Duckwater,_Nevada boost-neartitle:5km,Duckwater,_Nevada boost-neartitle:20km,Duckwater,_Nevada

For the randomly curious, here is how the scores work out for 50km within Coit Tower with 2km, 5km and 20km boosts. This can be fetched for any search by appending 'cirrusDumpResult&cirrusExplain=pretty` to the query string.

https://en.wikipedia.org/w/index.php?title=Special:Search&search=boost-neartitle%3A2km%2CCoit_Tower+boost-neartitle%3A5km%2CCoit_Tower+boost-neartitle%3A20km%2CCoit_Tower+neartitle%3A50km%2CCoit_Tower&cirrusDumpResult&cirrusExplain=pretty

The exact radius's to use with boosting is hard to decide, but it can be played arround with a bit to find reasonable results. Also while all these demonstrations are in km, can also use meters to be a bit more specific (boosting within 400 meters or some such ... whatever works best). The tradeoff for boosting within too narrow of a radius is that more uninteresting pages that are close might be pushed towards the top.

@EBernhardson Thanks for all that great detail! I'm sure, once we implement a proof-of-concept interface in the app, we'll be able to make all kinds of tweaks to the query, so that it gives the best possible results independent of location.

Change 303703 abandoned by Dbrant:
Filter results in Nearby.

Reason:
Stashing after a final rebase, pending much further Design and Discovery questions.

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

@Dbrant: Hi! This task has been assigned to you a while ago. Could you maybe share an update? Do you still plan to work on this task?
If this task is not resolved and only if you do not plan to work on this task anymore: Please consider removing yourself as assignee (via Add Action...Assign / Claim in the dropdown menu): That would allow others to work on this (in theory), as others won't think that someone is already working on this. Thanks! :)

This is no longer on the roadmap, I'm afraid.