We're updating the issue view to help you get more done. 

Advanced Queries return excessive results


I have a test site that includes 5 resources and 8,522 archival objects. I have an advanced query to return all the items that have been updated since a particular date (the all_ids parameter would be useful here, if it worked) which I can then filter by type:

1 curl -g -H "X-ArchivesSpace-Session: $S" 'localhost:8089/repositories/2/search?aq={"jsonmodel_type":"advanced_query","query":{"field":"user_mtime","value":"1969-12-31T18:00:00-06:00","comparator":"greater_than","jsonmodel_type":"date_field_query"}}&page=1&type[]=TYPE

If I filter by resource I get the correct number of results back (5) however, if I filter by archival_object I get 12420 "total_hits" (nearly 50% more hits than archival objects in the repository). I can only presume that there are 3,898 duplicates in the result set.

Any idea what is happening here? Any work-arounds? Alternatively, any easy ways to get a list of archival objects (resources, agents, etc) updated since a certain time via the API?

Side note: It appears that the SOLR values are a day earlier? All these items were created on 2019-01-08 but I need to use 2019-01-07 with the same time values to make the search work. E.g. setting the user_mtime field to '2019-01-08T20:29:00Z' returns no results where '2019-01-07T20:29:00Z' returns 3,856 results. Which, of course, IS a subset of the total number of archival_objects I have in the DB but still significantly more that the equivalent database search "select count(id) from archival_object where user_mtime > '2019-01-08 20:29:00';" which returns 1,879 archival_objects.







Seth Shaw