locked
Order by is not working when having two fields: double and string RRS feed

  • Question

  • I am sorting using the following criteria: 

    $orderby=listPrice, shortDesc

    but the result is being sorted by listPrice.  I tested it using just one at a time, and it worked but as soon as I set both fields the result from the search is sorted just by the listPrice.

    I tested my query using search explorer thinking that the C# wrapper had a bug but it did not work anyways.

    I am not sure how to troubleshot this issue.  I have other sort with two fields: int and string and it is working as expected.



    • Edited by Allan.Paramo Thursday, December 29, 2016 7:47 PM
    Thursday, December 29, 2016 7:42 PM

Answers

  • Thanks for confirming Allan. It looks like you may need to round up the prices to the nearest cent before uploading them, otherwise the results will be confusing.
    Tuesday, January 3, 2017 6:21 PM

All replies

  • Hi Allan,

    Can you please share your index definition (specifically the fields) as well as some sample data that illustrates the problem?

    Thanks,

    -Bruce

    Thursday, December 29, 2016 9:12 PM
  • Hi Bruce, 

    Thanks for comment this issue back.

    Here the fields definition from Azure portal, and a screen of the search result when sorting by the description and list price + description

    This is the sample data that I am using:

    What I noticed, and for sure it is the root of my issue (well I guess it is not an issue anymore), the decimal positions are telling me that the sort is correct.

    Thank, and sorry for the inconvenience.

    Allan 

    Tuesday, January 3, 2017 5:45 PM
  • Thanks for confirming Allan. It looks like you may need to round up the prices to the nearest cent before uploading them, otherwise the results will be confusing.
    Tuesday, January 3, 2017 6:21 PM