Person Data
Sorting Rules
phones[],emails[],locations[],socials[]: current entries first, then entries whose status is unknown, then entries known to have ended; within each, by confidence (high, thenmoderate, thenlow), then most recently seen (last_seen), then the number of sources (num_sources). Inlocations[], the place the top-levelcity,stateandcountry_codedescribe goes first, when one matchesexperience[]: the job the top-level job fields describe first, when one matches; then ongoing jobs (newest start first), then finished jobs (most recent end first), then undated oneseducation[]: ongoing first (newest start first), then finished (most recent end first), then undatedcertifications[]: most recently issued first, then by expiration date (latest first)skills[],languages[]: alphabetical bycleanedrawtext lists (everyrawarray, anywhere in the record): alphabetical, ignoring case
Contact Data Arrays
Phones, Emails, Locations, Socials
The rules above put the best phone or email first. Example phone array:Experience & Education
When the record has a top-level job,experience[0] is the job shown in job_title, company_name and company_legion_id. The other jobs, and education, follow the rules above.
Skills & Languages
These arrays are sorted alphabetically by thecleaned value:
Certifications
Sorted by issue date, most recent first, then by expiration date:Company Data
Sorting Rules
legion_employee_count_by_month[]: chronological (oldest month first)domains[]: the top-leveldomainfirst (when it is listed), then alphabetical bydomainlocations[]: the primary location first, then offices still operating, then closed ones; each group newest first bylast_seensocials[]: bynetwork, thenurltickers[]: bysymbol, thenexchangerawtext lists: alphabetical, ignoring case
Company
socials[] do not include confidence, num_sources, last_seen, or current fields, so quality-based sorting does not apply. They are ordered by network and url instead. Person socials[] do include these fields and place current items first.Headcount History
Thelegion_employee_count_by_month[] array places the oldest month first, so the last entry is the latest count:
Why Deterministic Ordering Matters
- Consistency: Same data always appears in the same order
- Predictability:
experience[0]is the top-level job,locations[0]the top-level place anddomains[0]the top-level domain - Filtering: Easier to find primary contact methods
- Testing: Deterministic output makes testing and validation easier
Related Documentation
- Field Formats - Format specifications
- Person Schema Example - See person arrays in context
- Company Schema Example - See company arrays in context