Sorting/Pagination

In this article you will find:



Sorting/Pagination

The sorting and pagination options for users can be managed in the workbench. A set of sorting and/or pagination options can be configured to display based on a highly configurable display trigger.



Navigating to the Sorting/Pagination Administration Page

 

1) To navigate to the Sorting/Pagination Administration Page, click on the "Workbench" tab in the top navigation.

2) Select "Data Configuration" from the left navigation

3) Choose "Sorting/Pagination" from the subcategories.  

You can modify each sorting set or pagination by using these icons: will allow you to edit, will copy the set, will display the rule, will delete the set, and provides info on the creation of the set.

To change the order of the sets, click on the  icon and drag the set up or down within the list. 

To add a new Sorting Set, click on the "Add Sorting" link or the Sorting box at the top of the page.

To add a new Pagination, click on the "Add Pagination" link or the Sorting box at the top of the page.


Add Sorting Set


1) First, give your sorting set a name by typing it into the "Name" field.

2) The "Code" field allows you to specify a code to be used to overwrite the functionality of selecting a sorting option based on the priority and trigger that matched the criteria. When passing the code parameter, this sorting set will be used and no other rules will be considered.

3) To add a new Sorting Option, click on the "Add Sorting Option" button. See below for more detailed instructions on adding a new Sorting Option.

4) Determine if you want "ALL" conditions to be met in order for the banner to display, or if it is enough that "ANY" one of the conditions be met. Select your choice from the drop-down. 

5) Choose "[+] Add Condition" to add a new condition.

6) Select the Field that will apply to the Display Rule from the drop down menu.

7) Select a corresponding operator from the drop down menu.

8) Enter the value that will satisfy the condition to display the set.

9) To add a sub-condition click the ">" button next to the existing condition. To delete a sub-condition, click the "-" button next to the condition you wish to delete. To add an additional independent condition click the "Add Condition" button from step 5.

10) Hit the "Save" button to add your new Sorting Set.

Add Sorting Option






1) Create a label for your Sorting Option (e.g. "Title (A-Z)").



2) Enter the parameter that you would like to have appended to the url for this sort. For example, "titleasc" would be used for an ascending sort on "Title" and would show up in the URL as "demo.hawksearch.net/?sort=titleasc."

3) Select your default sorting option by moving the slider to "ON".


4) Determine if you'd like to allow pinned items to be pinned to the top for the specified sorting options. For example, you may want pinned items to be at the top for Best Sellers, but then not show pinned items when a customer sorts by price. 

5) Add or delete fields to be used as sorting values by clicking on "Add" or .

6) Choose a value provided in the drop down box.

7) Select "+Add" to add the new value.

8) When you are finished adding all of your Sorting Values, select "Done" to return to the main screen.

9) Choose whether you would like each field to be sorted "Asc" (ascending) or "Desc" (descending). You can also delete a field by selecting theicon, or rearrange the order of the fields by dragging them using the  icon.


Sorting Option for Fields with Empty Attribute Values

We also have an option to ignore items that have null/zero/empty string as a field value for sorting and push them to the bottom of a search results set. 


Note: This feature is applicable to numeric fields only.   


  1. Value of the numeric field is left empty
  2. Value of the numeric field is Zero (0)
  3. Value of the numeric field is set to "null"




Add Pagination

The pagination options for users can be managed in the workbench. A set of paginations options can be configured to display based on a highly configurable display trigger.



1) First, give your pagination a name by typing it into the "Name" field.

2) The "Code" field allows you to specify a code to be used to overwrite the functionality of selecting a sorting option based on the priority and trigger that matched the criteria. When passing the code parameter, this sorting set will be used and no other rules will be considered.

This can be achieved by sending the below parameters in the request:

  • Sending hawksort=TheSortingSetCodeValue in the url for Hawksearch v2.0L - 4.0L

  • Sending "SortingSetCode" :"TheSortingSetCodeValue" in the search request for Hawksearch v4.0


3) Number of Page Links

4) Show First and Last Links?

5) Add Pagination Options

6) Display Rule

7) Hit the "Save" button to add your new pagination.