These constants control the ordering of results returned from the various search methods.

A single sort-by constant can be combined with a direction control constant using the bitwise-OR (|) operator.

sortby=S_*|S_ASC
sortby=S_*|S_DESC
Sort-by constants cannot be combined with other sort-by constants.

1. Sort Direction

These constants control the overall direction of the sorted results.

Sort Constant Description

pyvgx.S_ASC

Sort ascending, i.e. low to high

pyvgx.S_DESC

Sort descending, i.e. high to low

2. Sort By

These constants control how results are ordered.

Sort Constant Type Sort by Description Default Order

pyvgx.S_NONE

-

-

Search results are ordered according to internal traversal. This is generally faster than other sorts.

undefined

pyvgx.S_VAL

int or float

Arc (predicator) value

Effective only for methods supporting arc= filters.

Descending

pyvgx.S_ADDR

int

Memory address

Sort by terminal vertex object’s internal memory address. This may lead to faster processing of large search results in some cases.

Ascending

pyvgx.S_OBID

str

Vertex internalid

Sort by vertex internalid

Ascending

pyvgx.S_ID

str

Vertex identifier

Sort by vertex identifier string

Ascending

pyvgx.S_DEG

int

Vertex degree

Sort by vertex total degree (indegree + outdegree)

Descending

pyvgx.S_IDEG

int

Vertex indegree

Sort by vertex indegree

Descending

pyvgx.S_ODEG

int

Vertex outdegree

Sort by vertex outdegree

Descending

pyvgx.S_SIM

float

Vertex vector similarity

Sort by the similarity score computed for terminal vertex vector and probe vector supplied in the query

Descending

pyvgx.S_HAM

int

Vertex vector fingerprint hamming distance

Sort by the fingerprint hamming distance for terminal vertex vector and probe vector supplied in the query

Ascending

pyvgx.S_RANK

float

Generic rank score

Sort by a rank score as computed by a rank score evaluation function (query dependent feature).

When supported by a query method, the rank scoring specification must be provided in the rank= query parameter:

rank=<rank_spec>

The <rank_spec> syntax depends on the query method.

Descending

pyvgx.S_TMC

int

Vertex created timestamp

Sort by vertex creation time (1 second resolution)

Ascending

pyvgx.S_TMM

int

Vertex modified timestamp

Sort by vertex modification time (1 second resolution)

Ascending

pyvgx.S_TMX

int

Vertex expires timestamp

Sort by vertex expiration time (1 second resolution)

Ascending

pyvgx.S_NATIVE

int

No sorting

Similar to pyvgx.S_NONE but will complete deep traversal to gather counts and other metrics

undefined

pyvgx.S_RANDOM

float

Random sorting

The sort order will be randomized. Repeated searches will return a different random sort order each time.

undefined

3. pyvgx.S_NONE

pyvgx.S_NONE = 0

4. pyvgx.S_ASC

pyvgx.S_ASC = 1

5. pyvgx.S_DESC

pyvgx.S_DESC = 2

6. pyvgx.S_VAL

pyvgx.S_VAL = 16

7. pyvgx.S_ADDR

pyvgx.S_ADDR = 32

8. pyvgx.S_OBID

pyvgx.S_OBID = 48

9. pyvgx.S_ID

pyvgx.S_ID = 64

10. pyvgx.S_DEG

pyvgx.S_DEG = 80

11. pyvgx.S_IDEG

pyvgx.S_IDEG = 96

12. pyvgx.S_ODEG

pyvgx.S_ODEG = 112

13. pyvgx.S_SIM

pyvgx.S_SIM = 144

14. pyvgx.S_HAM

pyvgx.S_HAM = 128

15. pyvgx.S_RANK

pyvgx.S_RANK = 160

16. pyvgx.S_TMC

pyvgx.S_TMC = 176

17. pyvgx.S_TMM

pyvgx.S_TMM = 192

18. pyvgx.S_TMX

pyvgx.S_TMX = 208

19. pyvgx.S_NATIVE

pyvgx.S_NATIVE = 224

20. pyvgx.S_RANDOM

pyvgx.S_RANDOM = 240


PYVGX