Esri / geoportal-server-catalog

Esri Geoportal Server is a next generation open-source metadata catalog and editor, based on elasticsearch.
https://www.esri.com/en-us/arcgis/products/geoportal-server/overview
Apache License 2.0
100 stars 63 forks source link

Catalog results don't load after commit 406adc57c51bbeab35de0a2fa4c478f59c4b73ed #547

Closed rhodges closed 4 months ago

rhodges commented 4 months ago

Describe the bug A clear and concise description of what the bug is. Loading /geoportal/ (or /geoportal/#searchPanel) in a browser, instead of results, I get the message "An error occurred." The query to elasticsearch /elastic/metadata/_search?from=0&size=10

To Reproduce Steps to reproduce the behavior:

  1. Clone master and check out the commit 24e47e596e37bad96c1b79e09194185721bbe34a (when the commit was merged in)
  2. mvn clean install
  3. Deploy the .war file on Tomcat
  4. Open your.url/geoportal/ in your browser
    • Page loads without results
    • Elasticsearch query, now missing sort in URL, but with 'sort' in the request fails (see screenshot)

Request:

/elastic/metadata/_search?from=0&size=10

parameters:

{ 
   aggregations: {...}, 
   sort:{
      title.keyword: {
         order:"asc", 
         unmapped_type:"String"
      }
   }, 
   track_total_hits: true
}

Expected behavior The query to load all initial results should populate the catalog page.

Working query: Request:

/elastic/metadata/_search?from=0&size=10&sort=%7B%22title.keyword%22%3A%20%7B%22order%22%20%3A%20%22asc%22%20%2C%22unmapped_type%22%3A%20%22String%22%7D%7D

request context:

{ 
   aggregations:{...}, 
   track_total_hits: true
}

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

Additional context GeoPortal Server Stack:

as0050629 commented 4 months ago

@rhodges Sort is not giving error in GET query String as it was ignored by elastic and hence Sort was not working, but it was not giving any error too. Sort param needs to go in POST request.

Could you please test with this branch and let me know.

https://github.com/Esri/geoportal-server-catalog/tree/Issue--547

rhodges commented 4 months ago

@as0050629 - That seems to have fixed it! After building I see all of my records. Thanks!

NOTE: Sorting does not work - by name or date, ascending or descending, all items are in the same order every time.

mhogeweg commented 4 months ago

awesome! thanks for your willingness to test this fix.