geomoose / gm3

GeoMoose 3 Development. Please submit pull requests to the 'main' branch.
https://www.geomoose.org
MIT License
58 stars 59 forks source link

Single Field Search and Search by List Fail on Type AGS-Vector #870

Open chughes-lincoln opened 1 month ago

chughes-lincoln commented 1 month ago

The standard geomoose search works with type ags-vector (i.e. specify a list of fields that the user can individually search - i.e. the search specified here - https://docs.geomoose.org/3.x/howto/configure-search-fieldrequired.html).

It fails with both the single field search and search by list examples specified here - https://docs.geomoose.org/3.x/howto/configure-search-or-fields.html. It results in no results found and throws a console error.

Console error that occurs when trying to use search by list/single field search with ags-vector: image

brentfraser commented 1 month ago

Looking at the GeoMoose Protocol Support page, I see Search is supported (or it was when I did my testing) if the Arc GIS server is configured for Supported Operation:Query. Is that the case for your data source?

chughes-lincoln commented 1 month ago

Yes, Query is enabled, and I've gotten it working for the standard search, it's just search by list and the single field search that aren't working.

brentfraser commented 1 month ago

The doc seems to differ slightly from the single-search code in the examples app.js. Not sure if the differences are significant.

chughes-lincoln commented 1 month ago

Not sure how much the distinctions matter. My code matches the single-search example code, though I copied the doc code and it worked just fine on a postgres dataset.

Regarding the ags-vector issue, I'm using the same code that's working for a wfs map-source, just swapping out the map-source name and fields.

brentfraser commented 1 month ago

It's been a few years, but I seem to recall a problem with the "ilike" parameter. Try switching to "like".

brentfraser commented 1 month ago

And maybe use the network tab in the browser's debugger to examine the query sent to the server and the server's response.

chughes-lincoln commented 1 month ago

I'm seeing the same issues with "like". The network tab doesn't show any traffic. For the multi-field search (that works) I can see the query to the server and the response, but for the single-field and list searches the only traffic are the search templates.

brentfraser commented 1 month ago

Sounds like GeoMoose is having trouble constructing the query. Looking at the code, you better not have any single quotes in your search term. But I expect there's a bug (or lack of doc) in GeoMoose.