Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

sortBy & sortOrderToken Count OutputDescription
unspecified

orange 1

banana 2

acorn 2

apple 1

coconut 1

A-team 1

Xylophone 3

apple 1

coconut 1

if the parameter sortBy is not specified, the returned result does not guarantee any ordering of the token-occurrence pairs, nor does it guarantee the same ordering of these pairs between any 2 runs with the exact same parameters

sortBy=token&

sortOrder=asc

A-team 1

Xylophone 3

acorn 2

apple 1

banana 2

coconut 1

orange 1

with ascending ordering on the tokens, the returned result is sorted using the UTF-8 value of the tokens in ascending order.  In this example, the tokens starting with capital letter "X" come before these starting with lower case letter "a".

sortBy=token&

sortOrder=desc

orange 1

coconut 1

banana 2

apple 1

acorn 2

Xylophone 3

A-team 1

this is the exact reverse of the case above

sortBy=count&

sortOrder=asc

A-team 1

apple 1

coconut 1

orange 1

acorn 2

banana 2

Xylophone 3

with ascending ordering on the occurrence count, the returned result is sorted using the count value in ascending order; however, when multiple tokens have the same count, the order is determined by the ascending ordering of the tokens.

sortBy=count&

sortOrder=desc

Xylophone 3

banana 2

acorn 2

coconut 1

apple 1

A-team 1

this is the exact reverse of the above case, and specifically, when multiple tokens have the same count, the order is determined by the descending ordering of the tokens.

...