Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoSearchGenerator does not support query continuation #64

Open
CXuesong opened this issue Jan 19, 2020 · 4 comments
Open

GeoSearchGenerator does not support query continuation #64

CXuesong opened this issue Jan 19, 2020 · 4 comments
Labels
blocked-external The issue is blocked by an external issue/problem bug MediaWiki

Comments

@CXuesong
Copy link
Owner

Currently, GeoSearchGenerator does not support query continuation, because MW API action=query&list=geosearch does not support so. This is tracked by phab:T95241 and phab:T78703.

Example response of https://en.wikipedia.org/w/api.php?action=query&maxlag=5&list=geosearch&gsradius=10&gsprimary=primary&gslimit=2&gsbbox=32.15%7C34.75%7C32%7C34.9

{
    "batchcomplete": "",
    "query": {
        "geosearch": [
            {
                "pageid": 18328987,
                "ns": 0,
                "title": "Beit Zvi",
                "lat": 32.078408333333336,
                "lon": 34.821713888888894,
                "dist": 489.4,
                "primary": ""
            },
            {
                "pageid": 46324352,
                "ns": 0,
                "title": "HaAliya HaShniya Garden",
                "lat": 32.0697,
                "lon": 34.8148,
                "dist": 1127.4,
                "primary": ""
            }
        ]
    }
}
@CXuesong CXuesong added MediaWiki bug blocked-external The issue is blocked by an external issue/problem labels Jan 19, 2020
@CXuesong CXuesong changed the title Query continuation of GeoSearchGenerator GeoSearchGenerator does not support query continuation Jan 19, 2020
@CXuesong
Copy link
Owner Author

CXuesong commented Jan 19, 2020

I think the current mitigation we only have is to use a larger PaginationSize (gslimit) for now. But note that this value should be no greater than 500 for users and 5000 for users with apihighlimits right.

@HarelM
Copy link

HarelM commented Jan 19, 2020

The only workaround I can think of is to implement an area breakdown when limit is reached in this case.
i.e. Take the rectangle, split it to 4 smaller rectangles and search those until the pagination limit of 500 is not reached.

@CXuesong
Copy link
Owner Author

That should help. However, IMO this is not general enough for WCL to implement a common logic to fill this gap. This approach does not applies to the search by radius.

I've pinged in T78703 and am going to see what happens. Before that, if necessary, you may need to implement the rectangle break-down logic by yourself.

@HarelM
Copy link

HarelM commented Jan 19, 2020

@CXuesong thanks again for the super quick response and detailed investigation of the issue.
It's a delight to converse with you and see how professionally you handle things. So thanks again!
I understand your point of view and I myself wasn't sure where this temporary workaround should be implemented.
As a quick fix for the issue I have I'll implement this on my end, if needed of course you're welcome to copy the relevant code.
The status of my fix and relevant commits will be tracked here, in case this will interest you:
IsraelHikingMap/Site#1126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-external The issue is blocked by an external issue/problem bug MediaWiki
Projects
None yet
Development

No branches or pull requests

2 participants