Community
Participate
Working Groups
When the server returns the results one page at a time, we need to make sure all matches in the same folder arrive on the same page. The server should sort results by location.
I am going to focus on the list orientation based on our discussions this week. The list orientation has two columns - name and location. Currently it sorts by name by default, but the user will definitely want to sort by either name or location depending on what they are doing. As a starting point I will sort by name on the server and disable the client side sorting. In the end we are going to want to allow the user to sort by either name or location, and even toggle ascending vs. descending order. This is all quite easy to do on the server, although it means we need to re-perform the search to switch sort order. This makes sense because it is closely tied to pagination.
I have done the following: - Added new field to the search index, "Path". This is the created using the project name, and appending the project-relative path of the content. This ends up with a string just like the "Location" column in the search results - Changed sorting to be based on Path by default. The URL can be changed to sort by name, or to reverse the sort order. I imagine these could be wired up to URLs in the column header to switch the column used for sorting. Example: Sort by path, ascending: /search/search.html#?sort=Path asc&rows=40&start=0&q=foo By path, descending: /search/search.html#?sort=Path desc&rows=40&start=0&q=foo By filename, either ascending or descending: /search/search.html#?sort=Name asc&rows=40&start=0&q=foo /search/search.html#?sort=Name desc&rows=40&start=0&q=foo
Libing, this is mostly working well, with one exception. If I sort by Name and use the List orientation, something on the client side is changing the sort order of the list. I can't find the code that is doing this. If I use the following URL, I can see the JSON list comes back from the server sorted correctly, but somehow the table ends up grouped by project, and then sorted correctly within each project. Any idea what might be doing this?
(In reply to comment #3) > Libing, this is mostly working well, with one exception. If I sort by Name and > use the List orientation, something on the client side is changing the sort > order of the list. I can't find the code that is doing this. If I use the > following URL, I can see the JSON list comes back from the server sorted > correctly, but somehow the table ends up grouped by project, and then sorted > correctly within each project. Any idea what might be doing this? Forgot the URL: http://localhost:8080/search/search.html#?sort=Name asc&rows=40&start=0&q=foo
(In reply to comment #4) > (In reply to comment #3) > > Libing, this is mostly working well, with one exception. If I sort by Name and > > use the List orientation, something on the client side is changing the sort > > order of the list. I can't find the code that is doing this. If I use the > > following URL, I can see the JSON list comes back from the server sorted > > correctly, but somehow the table ends up grouped by project, and then sorted > > correctly within each project. Any idea what might be doing this? > > Forgot the URL: > > http://localhost:8080/search/search.html#?sort=Name asc&rows=40&start=0&q=foo Flat list uses all the leaf nodes in the tree model. So even you removed the sorter, the leaf nodes are still "grouped" by their parent chain. I will comment this on Bug 364744 to use the original list from server.
John, Bug 364744 is fixed. I think you can close this server bug. Bug 365146 addresses client side pagination issues, but that is pure UI stuff.
Server sorting is now complete.