5

I am able to make query from QueryBuilder, and query is working fine while executing directly in Fredhopper.

But surprisingly I am getting no results in my DD4T MVC application.

i.e ResultSet fredHopperResultset = queryBuilder.Execute(); returns null in my application although QueryBuilder contains correct query.

I checked smart target logs where I found no errors, also FredHopper log contains right Fredhopper query,only one thing which i noticed in my Fredhopper logs that it contains 8181 port instead of 8180 that is

http://127.0.0.1:8181/fredhopper/query?fh_location=%2F%2Fcatalog01%2Fen_USsomeothertriggers

Although while executing i get same results by

http://127.0.0.1:8181/fredhopper/query?fh_location=%2F%2Fcatalog01%2Fen_USsomeothertriggers

and

http://127.0.0.1:8180/fredhopper/query?fh_location=%2F%2Fcatalog01%2Fen_USsomeothertriggers

2 Answers 2

5

There could be few things which you can check for the reason why your query is returning result while executing directly in fredhopper and not returning result in your application:

  1. Check the log of your application if your query is getting timed out.
  2. You default promotion with title containing "Do not remove" is present in fredhopper.
  3. Check your application and fredhopper log if you are able to see any error message.
4
  • I didn't know about the "do not remove" promotion--what does that do? Commented Dec 1, 2015 at 21:56
  • Thanks Mukesh,I found on my application logs (Basically smart target logs) that Metadata promotion is not available,which meant that somebody accidentally deleted this default promotion which was causing the error, i just restored it from business manager recycle bin and things are working fine then. @AlvinReyes SmartTarget Meta Promotion (do not remove!) is a default promotion which business manager provides,automatically added when we install smart target,i think it's mandatory to work smart target. Commented Dec 2, 2015 at 6:28
  • Not quite. The meta Promotion is created by SmartTarget and holds additional information about the Promotions, such as their relative positions, whether or not it's an Experiment, whether it includes child Publications, etc. SmartTarget needs that to work and will recreate it if it does not exist -- but deleting the meta Promotion obviously means you lose a lot of data, which is one of the reasons why Promotions are hidden in the Business Manager by default. You should hide them again, @RahulSharma, since you've already been bit by it. Commented Dec 2, 2015 at 10:19
  • It is recommended to manage your promotions through Tridion UI and not through business manager. Default promotion present in fredhopper, hold the information used by Smart target to work on the result provided by fredhopper. Commented Dec 2, 2015 at 10:26
2

Also make sure that,

  1. The publication context of your web application and published content's should be same.
  2. Claims(triggers) are passed to your query as shown below:

    ClaimStore claims = AmbientDataContext.CurrentClaimStore;
    String triggers = AmbientDataHelper.GetTriggers(claims);
    ....
    QueryBuilder QB = new QueryBuilder("catalog01","en_US");
    QB.AddCriteria(new Tridion.SmartTarget.Query.Builder.PublicationCriteria(new TcmUri("tcm:0-12-1")));
    .....
    QB.Parse(triggers);
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.