<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title></title></head><body><p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">Dear all,</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">as my previous post collects views but no answers I want to share my gained knowledge with you and set up a new question.</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">The biggest surprise for me was QWC2 search function uses the same functions as the original QWC (or may be not....?), My thinking of: New Client means new seach providers and functions was wrong. </span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">This post was very helpul: <a href="http://osgeo-org.1560.x6.nabble.com/Address-Search-td5389157.html">http://osgeo-org.1560.x6.nabble.com/Address-Search-td5389157.html </a></span><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none"> (first 2 paragraphs).</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">Actualy a good notice as the "old" search function setup is well documented in QWC-github (<a href="https://github.com/qgis/QGIS-Web-Client/tree/master/wsgi">https://github.com/qgis/QGIS-Web-Client/tree/master/wsgi</a>). I choose the wsgi-way so the chapter 6.2.xx gave the information. At the POSTGIS-side I use searchviews.</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">Meanwhile I upgraded my server to Debian buster with Apache 2.4.38 and use all Debian-provided modules (e.g. libapache2-mod-wsgi). As long as you can make sure the Python2.7-environment handles the search.wsgi.script there is in the end no big problem to generate a new virtual host with the wsgi-functionality. For testing purpose I set /etc/hosts to "127.0.0.1 wsgi.myhiddendomain.com wsgi" and that works well.</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">A very good source to deal with wsgi-problems is this one: <a href="https://modwsgi.readthedocs.io/en/develop/user-guides/quick-configuration-guide.html">https://modwsgi.readthedocs.io/en/develop/user-guides/quick-configuration-guide.html</a></span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">Unfortunately all my stuff is behind a firewall so I have to post my settings.</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">Generating a web-request to my wsgi-host with:</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none"><a href="http://wsgi/attributsuche?searchtables=intern.geodin&query=423C-3003">http://wsgi/wsgi/search.wsgi?searchtables=boreholesearchview&query=423C-3003</a></span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">produces this fine result:</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">{"results": [{"searchtable": null, "displaytext": "Bohrpunkte GeOdin: ", "bbox": null, "showlayer": "Daten aus fis_re_bohrpunktegeo"}, {"searchtable": "boreholesearchview", "displaytext": "423C-3003 von 1910 auf 35m: 7m Tiefe", "bbox": [387946.19,5820458.8,387946.19,5820458.8], "showlayer": "Daten aus fis_re_bohrpunktegeo"}]}</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">This very similar to examples given by the "uster"-team (see js/SearchProvider.js for details) in their web-posts and my test runs with their search machine.</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">I altered the original search.wsgi in line 132 and 134 to avoid the (in my eyes useless) "selectable"-entry.</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">Using the Swisstopo-search-engine (provided in js/SearchProviders.js too and enabled in themesConfig.json) is currently the only way to enable a search funtionality as it is desired for the borehole data.</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">request:</span></p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none"><a href="http://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=Naturfreundehaus%20Grindelwald&type=locations&limit=20">http://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=Naturfreundehaus%20Grindelwald&type=locations&limit=20</a></span></p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">answer:</span></p>
<pre>{"results":[{"id":100816,"weight":3,"attrs":{"origin":"gazetteer","geom_quadindex":"021333000031220311132","zoomlevel":4294967295,"lon":8.035799980163574,"detail":"grindelwald, naturfreundehaus haltestelle bus","rank":8,"geom_st_box2d":"BOX(645731.809781232 164339.237855834,645731.809781232 164339.237855834)","lat":46.62873840332031,"num":1,"y":645731.8125,"x":164339.234375,"label":"<i>Bus</i> <b>Grindelwald, Naturfreundehaus</b>"}}]}<br /><br /><span style="font-family: arial, helvetica, sans-serif;">Studying the function geoAdminLocationSearch (in js/SearchProviders.js) I learned their "stripping" (using "only" 'BOX' as 'bbox', 'label' as 'displaytext' and '"origin":"gazetteer"' for group generating) of the answer in a way qwc2 can understand and place a hit in the map.<br /><br />As I'm not a developer I can only play around with the provided code examples but I didn't found out how to set up the things for my case.<br /><br />So I hope the "old" search functions of QWC can deal with QWC2 needs and I still hope somebody knows and tell the way to do it.<br /><br />regards<br /><br />Torsten<br /><br /></span></pre></body></html>