Closed AFoletti closed 6 years ago
Sorry @procrastinatio , are you telling me that by following the steps I described you are getting a result? Because I'm consistently getting none...
there are line feeds in the database, that's why the ilike is not working. This is the query string which is not working:
http://localhost:9076/rest/services/all/MapServer/identify?geometryFormat=geojson&imageDisplay=1169,803,96&lang=en&layers=all:ch.bakom.notruf-112_mobilnetz&mapExtent=2454734.813976,1000064.9423119999,2952121.6260240003,1341725.857688&returnGeometry=true&sr=2056&tolerance=5&where=mo_addresse_112 ilike '%Etat de Genève Police Cantonale
Chemin de la Gravière 9
1227 Les Acacias%'
I think you need the line feeds for the tooltip. For each queryable attribute with line feeds, you could add a (queryable attribute search only) column to the view and replace line feeds with space
regexp_replace(mo_addresse_112, '\r|\n', ' ', 'g') as mo_addresse_112_queryable
This is how the values for the selection are generated: line feeds are replaced with spaces by the json renderer. So they're not visible here: http://localhost:9076/rest/services/all/MapServer/ch.bakom.notruf-112_mobilnetz/attributes/mo_addresse_112
Thanks for your analysis @ltclm Do we need to add a column to a view in order to solve the problem or could we solve it in the sphinx config? This would spare us some tinkering with the DB
you have to add columns to the view. sphinx is not involved in the queryable attribute stuff.
an alternative solution would be: https://github.com/geoadmin/mf-chsdi3/blob/ee88d1b4323b27fbe4630434e833874aa4f841a5/chsdi/lib/helpers.py#L185
replace line feeds with %
when generating the ilike string, but im not sure about side effects, i can give it a try if you want.
Personally I would like a general solution better than a per-layer one. We could very well encounter the same issue in other layers (and we probably we already have that... we simply did never notice the issue) and it would be stupid to have to add a special column just to solve this issue.
But I understand that the general solution in chsdi is more demanding in terms of time.
@danduk82 and @gjn your opinion?
pr and testlink are here: https://github.com/geoadmin/mf-chsdi3/pull/2978
Well, that was fast
Steps to reproduce:
Result:
Expected result:
Note:
Thanks for having a look!!