I can see the promotions are getting filtered out based on triggers properly in QueryServer and Indexer Server Preview mode, but when I am trying fetch the Promotion using SmartTarget API, I am getting no promotions in resultset.
I have created Custom dummy Cartridge for location claim. I am using Keyword based trigger for location in SmartTarget and also configured in TriggerType.xml
in Fredhopper. For testing I have hard coded the TCM URI of location Keyword I have selected in SmartTarget Promotion.
Below is code snippet I am using for SmartTarget API
Util.TcmUri pageUri = new Util.TcmUri(String.Format("tcm:{0}-{1}-64", localization.LocalizationId, smartTargetPageModel.Id));
Util.TcmUri publicationUri = new Util.TcmUri(0, pageUri.PublicationId, 1);
ClaimStore claimStore = AmbientDataContext.CurrentClaimStore;
var locationClaim = claimStore.Get<string>(new Uri("taf:claim:ambientdata:locationcartridge:userlocation"));
string locationId = "tcm:28-695-1024";
if (locationClaim == null)
{
claimStore.Put(new Uri("taf:claim:ambientdata:locationcartridge:userlocation"), locationId, global::Tridion.ContentDelivery.AmbientData.Runtime.ClaimType.Normal, global::Tridion.ContentDelivery.AmbientData.Runtime.ClaimValueScope.Session);
}
string triggers = AmbientDataHelper.GetTriggers(claimStore);
QueryBuilder queryBuilder = new QueryBuilder();
queryBuilder.AddCriteria(new PublicationCriteria(publicationUri));
queryBuilder.AddCriteria(new PageCriteria(pageUri));
queryBuilder.AddCriteria(new RegionCriteria("Offers"));
queryBuilder.Parse(triggers);
return queryBuilder.Execute();
Please note that I have added Query Service capability in Content Discovery service and I am not using TCDL tags in presentation site. In log file of query service, I am not getting error but it does not show that query server is getting called, only getting below log in smart-target log file of query service.
2017-05-23 06:24:41,804 INFO WebServiceExecutor - Trigger-Types are successfully retrieved. Response status code: 200
2017-05-23 06:24:42,039 INFO WebServiceExecutor - trigger-types are successfully retrieved
2017-05-23 06:44:14,020 INFO ConfigurationUtility - Loading Mappings for Publications
2017-05-23 06:44:16,763 DEBUG QueryEntityRegister - Registering entity data models
2017-05-23 07:03:40,954 DEBUG TriggerTypeDataSourceProvider - SelectOperation: Getting all trigger types.
2017-05-23 07:03:40,995 INFO WebServiceExecutor - Trigger-Types are successfully retrieved. Response status code: 200
2017-05-23 07:03:41,200 INFO WebServiceExecutor - trigger-types are successfully retrieved
2017-05-23 07:07:48,533 DEBUG TriggerTypeDataSourceProvider - SelectOperation: Getting all trigger types.
2017-05-23 07:07:48,541 INFO WebServiceExecutor - Trigger-Types are successfully retrieved. Response status code: 200
2017-05-23 07:07:48,545 INFO WebServiceExecutor - trigger-types are successfully retrieved
2017-05-23 07:07:57,177 DEBUG TriggerTypeDataSourceProvider - SelectOperation: Getting all trigger types.
2017-05-23 07:07:57,186 INFO WebServiceExecutor - Trigger-Types are successfully retrieved. Response status code: 200
2017-05-23 07:07:57,191 INFO WebServiceExecutor - trigger-types are successfully retrieved
queryBuilder.ToString()
does it still include the Publication, Page, and Region criteria? Also, the fact that it doesn't seem to call the query server is very suspicious -- are you sure it's not going to another instance than the one you expected?