I used magical powers to guess the internals of the SmartTarget Query Tag to get a code example of how to query SmartTarget using the API. You can set a
MaxItems attribute on the tag, which I see translates through to a
fh_view_size parameter in the query string to Fredhopper. I notice that when this parameter is set, Fredhopper returns an
items collection in the ResultSet object, with as many items in it as the max specified, and an
itemsTotalCount property set to match the size of this collection.
These items however do not seem to correspond to the actual items returned in the
promotions property in the
ResultSet, and indeed the number of items in the promotions remains unaffected by the max that I specify. So if the promotions return 3 results, even if I specifiy a max of 2, I still get three back, and these three do not necessarily correspond to the 2 items returned in the
Furthermore, if I don't specify a max, I get 10 items in the
items property, and an
itemsTotalCount of 32 (which seems to be the total number of promotional items I have published to the corresponding publication/target)
This is all pretty confusing, can anyone explain what these items/itemsTotalCount properties in the result set is for, and what they actually mean? Is there a way to get the actual number of promotional items filtered to a max value?