Verify NATURAL_ORDER is used correctly or replace with SortByImpl

Description

Using NATURAL_ORDER with ResultIterator can have inconsistent result if result size > page size.

See

When SolrClient return unsorted result combining with paging, duplicate results are returned on the second page. Resulting in missing result set.

Cases to consider
Field
NATURAL_ORDER
Found usages
Value read
catalog-ui-search
org.codice.ddf.catalog.ui.metacard
MetacardApplication
getMetacardHistory(String)
SortBy.NATURAL_ORDER,
org.codice.ddf.catalog.ui.metacard.associations
Associated
query(Filter)
SortBy.NATURAL_ORDER,
org.codice.ddf.catalog.ui.metacard.notes
NoteUtil
getAssociatedMetacardsByTwoAttributes(String, String, String, String)
SortBy.NATURAL_ORDER,
org.codice.ddf.catalog.ui.scheduling
QueryExecutor
runQuery(Subject, Map<String, Object>)
? SortBy.NATURAL_ORDER
spatial-geocoding-offline-catalog
org.codice.ddf.spatial.geocoding.index
GeoNamesCatalogIndexer
removeGeoNamesMetacardsFromCatalog(String, ProgressCallback)
filter, 1, BATCH_SIZE, SortBy.NATURAL_ORDER, false, TimeUnit.SECONDS.toMillis(90));
org.codice.ddf.spatial.geocoding.query
GazetteerQueryCatalog
getNearestCities(String, int, int)
Query query = new QueryImpl(queryFilter, 1, maxResults, SortBy.NATURAL_ORDER, false, TIMEOUT);

Environment

None

Status

Assignee

Unassigned

Reporter

Jason Lam

Labels

None

Affects versions

2.11.6

Priority

Critical
Configure