Issue 13662

Support configurable ordering in the search

13662
Reporter: trobertson
Type: Bug
Summary: Support configurable ordering in the search
Priority: Major
Status: Open
Created: 2013-08-28 10:26:47.873
Updated: 2013-12-12 17:32:49.895
        
Description: In the NetworkEntityService (registry service API) we have:
{code}
  /**
   * A simple search that supports paging.
   *
   * @return a pageable response of network entities, with accurate counts.
   */
  PagingResponse search(String query, @Nullable Pageable page);
{code}

We should add an additional service which supports result ordering as follows:
{code}
  /**
   * A simple search that supports paging, with configurable response ordering
   *
   * @return a pageable response of network entities, with accurate counts, order as requested
   */
  PagingResponse search(String query, @Nullable Pageable page, OrderBy resultOrder);
{code}

The Order should be a public enum
{code}
  // Used for ordering result lists.  It is up to the implementer to choose a sensible field for alphabetic, where it is intended for generic lists for human reading
  public enum OrderBy {CREATED_ASC, MODIFIED_DESC, ALPHABETICAL}
{code}]]>
    


Author: mdoering@gbif.org
Comment: As NetworkEntity always has a getTitle() how about making APLHABETICAL rather TITLE_ALPHABETICAL, knowing that alphabetical ordering is also not 100% clear and depends on the actual collation used
Created: 2013-08-28 10:44:59.912
Updated: 2013-08-28 10:44:59.912