opengisch / solocator

GNU General Public License v3.0
0 stars 1 forks source link

Hierarchy of layer groups should be shown in the search results by using a dash as prefix #39

Closed andreasneumann closed 5 years ago

andreasneumann commented 5 years ago

Example: Search for "Richtplan" - https://geo.so.ch/api/search/v2/?limit=10&filter=dataproduct&searchtext=Richtplan

{
      "results": [{
            "dataproduct": {
                  "dataproduct_id": "ch.so.arp.richtplan",
                  "display": "Richtplan",
                  "dset_info": false,
                  "sublayers": [{
                        "dataproduct_id": "ch.so.arp.richtplan.vorhaben",
                        "display": "Richtplan Vorhaben (Richtplan)",
                        "dset_info": true,
                        "type": "facadelayer"
                  }, {
                        "dataproduct_id": "ch.so.arp.richtplan.bestehend",
                        "display": "Richtplan Ausgangslage (Richtplan)",
                        "dset_info": true,
                        "type": "facadelayer"
                  }],
                  "type": "layergroup"
            }
      }, {
            "dataproduct": {
                  "dataproduct_id": "ch.so.afu.abbaustellen.abbaustellen",
                  "display": "Abbaustellen",
                  "dset_info": true,
                  "type": "datasetview"
            }
      }, {
            "dataproduct": {
                  "dataproduct_id": "ch.so.afu.naturgefahrenhinweis",
                  "display": "Naturgefahrenhinweiskarte",
                  "dset_info": true,
                  "sublayers": [{
                        "dataproduct_id": "ch.so.afu.geologie.karst",
                        "display": "Karst",
                        "dset_info": true,
                        "type": "datasetview"
                  }, {
                        "dataproduct_id": "ch.so.afu.naturgefahrenhinweis.steinschlag",
                        "display": "Steinschl\u00e4ge",
                        "dset_info": true,
                        "type": "datasetview"
                  }, {
                        "dataproduct_id": "ch.so.afu.naturgefahrenhinweis.rutschung",
                        "display": "Rutschungen",
                        "dset_info": true,
                        "type": "datasetview"
                  }, {
                        "dataproduct_id": "ch.so.afu.naturgefahrenhinweis.wassergefahren",
                        "display": "Wassergefahren",
                        "dset_info": true,
                        "type": "datasetview"
                  }],
                  "type": "layergroup"
            }
      }],
      "result_counts": []
}

Should result in the following result (not modifying the order, see issue #38):

Richtplan
-   Richtplan Vorhaben (Richtplan)
-   Richtplan Ausgangslage (Richtplan)
Abbaustellen
Naturgefahrenhinweiskarte
-   Karst
-   Steinschläge
-   Rutschungen
-   Wassergefahren

Note the dash that indicates that - Karst is a child of Naturgefahrenhinweiskarte.

In addition, the filter on layernames against search string to reduce the nr of hits should be removed.