-
Notifications
You must be signed in to change notification settings - Fork 1
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
Mixed Filters #81
Comments
@andyb-esdm - not sure we ever anticipated this - can you have a check in your code to see if its something simple like you skipping out after you have found the simple one thinking tehre won't be a complex one as well ? |
@JamesPe No we didn't anticipate this (I don't really understand how it could work server side to be honest). I also perceived it as a mistake at the time to put type on the filter table instead of filterType on the layer table. |
@andyb-esdm ok thanks Andy, @JordanPinder @GMDuncan do you want to focus on this issue this month and save most of the other issues for later in the support contract? |
@HelenwoodsJNCC given that this would take the most time I'd agree in focusing on mixed filters this month using the 12 hours we have (8 regular & 4 carried from last month). |
@andyb-esdm can we focus on this issue for the support contract this month then please. I will close the other issues and re-open another month. Please let us know if you think it will take longer to sort out i.e if you would need to use any of next months hours. Thanks! |
@HelenwoodsJNCC Okay. I'll warn you if it looks like it will take longer but it really shouldn't. |
@andyb-esdm I think the final behaviour would be that both viewparams and cqlfilter would be passed through to the WMS request. So each would behave as they currently do, but are not mutually exclusive. I believe that Geoserver can handle both simultaneously, as I'm fairly certain that I tested this back at the beginning of the Geoserver move but I can confirm this for you if you want. An example would be for Annex I maps from survey. Here:
I didn't realise that the code structure was set up this way, though. So happy for alternatives to be found if they're more sensible? |
@GMDuncan My fault about the code structure! I had been thinking about creating a filter service class to provide more sophisticated filter handling, instead of just concatenating a string and setting a single parameter on the request. So now is the chance to do this. |
Warning: thought below, not to be taken as a request, just for comments! It's not currently possible without some horrendous SQL behind the scenes, but it would.... i think ... be possible if there was the option to "wrap" or "decorate" (depending on what word works best!) filter values before they get concatenated together, which sounds potentially in the same area of thinking of your thoughts above. The behaviour would be that if a user selected hab_type values of "A5,2" "A5.3" and "A2", and the wrapper on the filter was set as "{}%" with {} representing the value, the resulting query string would be something like &viewparams=hab_type:'A5.2%','A5.3%',A2%' which could be easily passed into the SQL view. This is something that is very much not required at the moment, but might make a good addition later. And if you're delving into this area in this ticket, i'm wondering if it would be beneficial to do anything at once? Keen on hearing your thoughts on this (whether it's a terrible idea, whether it's better done other ways etc!) just for consideration before delving into filter code twice... Also keen on @HelenwoodsJNCC @JordanPinder and @helen-lillis thoughts! |
@GMDuncan Something like this is entirely possible. Right now the filter vaues are reformatted to escape special characters etc. and that reformatting could be extended for different filter types. The detail here would be how these are configured server-side I guess? |
Sounds good - we can discuss this internally on a requirement level then and add on in future if necessary. I was thinking that client side, the Filter table could have an "InputWrapper" column which stores the pattern for value replacement in some easyish to understand way with a placeholder for the value. One question concerns behaviour for multiselect vs single value, whether to enable the behaviour on both or only enable for multiselect? To me it's probably safest to go with what's easier to code, as it's less necessary on a single value filter (because the wrapper can potentially just be stored in the SQL view itself), but depending on the code, enabling a default behaviour might be easier (or the same effort) as restricting the behaviour to one type! Anyway, will have a chat with everyone in-house about this. Also I just realised that I wrote "Like andy" in the comment above, obviously I meant "like any", but I think the typo works well too haha! |
@GMDuncan @HelenwoodsJNCC |
One other thing to note here is that the CQL_FILTER doesn't currently support free text. It's lookups only. I spoke to SA about this and neither of us can remember why that decision was made. Can either of you remember? If not, should I add it? |
Can't remember that decision reasoning myself, and freetext in CQL seems sensible, so I don't see why it couldn't be added if it's relatively painless? Thoughts @helen-lillis ? |
I've looked again at the CQL_FILTER. It creates a literal IN clause for look-ups i.e. it returns hab_type IN ('A1', 'A2') For example, we could wrap the search term with a LIKE and wildcards: 'mud' would translate to hab_type LIKE '%mud%' or hab_type LIKE 'mud%' etc. Terms with spaces could translate into IN (similar to lookup example) e.g. 'mud sand' would translate to hab_type IN ('mud', 'sand') So if I do implement this, then we'd need to settle on a single way for free text being handled I think? Maybe the complex (viewParams) approach makes this unnecessary because you can define how you want the search text handled in the view definition? |
Can we look into the issue the occurs when combining simple and complex filters on a single layer - first raised by Graeme in issue #37
The text was updated successfully, but these errors were encountered: