Closed arenger closed 6 years ago
Try configuring logging to view request data. Monitor the logs when making the problematic request and note the request object.
27 Dec 11:38:55 DEBUG [data.elasticsearch] - Elasticsearch request:
{
"size" : 100,
"query" : {
"bool" : {
"must" : {
"match_all" : { }
},
"filter" : {
"geo_bounding_box" : {
"geo" : {
"top_left" : [ -7.119140625, 55.634765625 ],
"bottom_right" : [ 31.201171875, -12.568359375 ]
}
}
}
}
},
"from" : 0
}
If the issue is not apparent in the request data you can post it directly against your Elasticsearch cluster to debug further.
$ curl -H "Content-Type: application/json" http://localhost:9200/status_s3/_search?pretty -d '
{
"size" : 100,
"query" : {
"bool" : {
"must" : {
"match_all" : { }
},
"filter" : {
"geo_bounding_box" : {
"geo" : {
"top_left" : [ -7.119140625, 55.634765625 ],
"bottom_right" : [ 31.201171875, -12.568359375 ]
}
}
}
}
},
"from" : 0
}
'
If you do need to handle requests returning a large number of features try setting the scroll_enabled
store parameter.
I'm suspecting you'll find the size in your request object is too large, likely because the maxFeatures
parameter is unset or set too large in your GetFeature WFS request. Try setting maxFeatures to something smaller.
For GeoServer WMS requests the default maxFeatures
is Integer.MAX_VALUE
but for WFS requests the default is 1000000 (configurable). The plugin has a store parameter (default_max_features) that is used when maxFeatures is Integer.MAX_VALUE
, which is why you don't observe the issue in WMS requests.
I finally got back to testing this with the scroll_enabled
parameter set -- and this resolved the problem. Thank you again for your help, @sjudeng .
Hello Again,
This is a helpful plugin, and I've got it work fine with WMS. However, I'm curious: Was this plugin/extension meant to also work WFS? As a test, I loaded a dataset in three different ways: in a postgis instance, in elasticsearch, and a shapefile uploaded to the GeoServer... all the same data, served via an instance of GeoServer 2.12.0 running in Docker. I then issued six different queries, all with the same bounding box:
1) WMS to the postgis layer 2) WFS to the postgis layer 3) WMS to the shapefile layer 4) WFS to the shapefile layer 5) WMS to the elasticsearch layer 6) WFS to the elasticsearch layer
The first five queries return without error and all return the same feature count. The 6th query fails with the following error.
I tried shrinking the bounding box, such that only two features are returned... but the same error occurs. Do you have any suggestions?