views:

27

answers:

1

Hi All,

How can I query the Sitecore archive and what can be queried ? For instance, can I make a query after the values of the fields of an archived Item ?

Kind Regards, M

A: 

I suppose you're talking about the API to query Archive data. If that's the case, take a look at the Sitecore.Data.Archiving.SqlArchive class, and its method GetEntries() in particular. One of the parameters it accepts is an ArchiveQuery instance.

If you look closer at ArchiveQuery class, you'll see that it is possible to query by item ID, Parent ID, Name, archive date range, original location and "archived by" data of the item being archived.

There seems to be no ad-hoc API to use field data in such queries, but the data of archived fields is still stored in ArchivedFields SQL table. And you can try to address it directly to accomplish what you need (at your own risk, of course).

Hope this helps.

Yan Sklyarenko