Posted on 13/10/2016 01:03:41
No, that is not possible. We only retrieve a subset of the results - so we just know how many there is. So if you query the index and you pagesize is 20, we get only 20 IDs from the index (or database if not using an index).
Using the Notifications.eCommerce.Querying.AfterQuery
notification (if you use the new index), you get an argument object where you have a Settings
property of type Dynamicweb.Querying.QuerySettings
Create a notification subscriber, and change the Settings.Take
to i.e. 1000 (or how many you want) and set the Settings.Skip
to 0 (will always be 0 on page 1) and execute the search on the index again:
Dim result As Dynamicweb.Querying.IQueryResult = ServiceLocator.Current.GetInstance(Of Querying.IQueryService)().Query(query, querySetting)
Now the result should give you the product auto ids:
Dim autoIDs As New List(Of Int64)
For Each element In result.QueryResult
Dim dict = DirectCast(element, Dictionary(Of String, Object))
Dim autoId = DirectCast(dict("AutoID"), Int64)
autoIDs.Add(autoId)
Next