Expand my Community achievements bar.

Join us for an upcoming in-person Adobe Target Skill Builders event ~~> We're hosting these live learning opportunities to equip you with the knowledge and skills to leverage Target successfully. Learn more to see if we'll be coming to a city near you!
SOLVED

Search & Promote Query to fetch content based on dates

Avatar

Level 1

We are trying to write an S&P query to retrieve content based on the date when it was created. Our requirement is to fetch the content in a date(system defined field) range. We went through the documentation and came up with a query parameters format as shown below. We just wanted to know is it the correct way or is there a better way to do it.

 

http://adobesnpdomain.com/?sp_q_min_day_2=01&sp_q_max_day_2=04&sp_q_min_month_2=01&sp_q_ma x_month_2=03&sp_q_min_year_2=2014&sp_q_max_year_2=2015

 

So we have used the backed search fields please let us know if there is another way to do it and how the same could be done in case the date field is a custom field.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Rajeev,

It should be defined as a pre-search rule and not as a business rule.

For better understanding about type of rules, please go through below link:

https://marketing.adobe.com/resources/help/en_US/snp/15.3.1/c_about_rules_menu.html

Thanks!

View solution in original post

4 Replies

Avatar

Level 10

Hi Rajeev,

There are few things I would want to highlight.

Do you have a user-defined date field. The example in the help section has a date field named “PublishDate”, so the query will also contain something like sp_x_2= PublishDate

See: https://marketing.adobe.com/resources/help/en_US/snp/r_backend_search_cgi_parameters.html

Ideally the only thing we find, parameter: q -> which will contain query term or “*”, in case if you want to retrieve complete database in the result set

All other parameters we see in the query: viz: sp_q_min_day_2, sp_q_max_day_2 are the parameters being passed to back-end to fetch the results for time interval specified.

Usually, this kind of settings will be done under Pre-search or business rule for the account. 

If you try backend search parameters directly on the website it might not work. This also depends on the settings in your account. What’s your spid?

Shekhar

Avatar

Level 10

Hi Rajeev,

Thank you for reaching out.

Kindly allow me some time to investigate on this and find the suitable answer. I appreciate your patience on this.

Thanks!

Avatar

Level 1

Hi Shekhar,

Thanks for the response. We are using the system defined field "date" to store one of out metadata. So is it safe to assume that we can ignore giving a parameter such as "sp_x_2=date". I mean with the above query format we are getting the expected result. Our main concern was that is this the right way to query S&P using backend parameters. And about the spid I am not supposed to share that info in a forum.

So our requirement is that the end user would provide the start and the end dates and we use it to create the above query is that possible if we define it as a business rule I mean would the rule be able to take the user supplied dates.

And also what are the benefits of using it as a business rule or Pre-Search.

Rajeev

Avatar

Correct answer by
Level 10

Hi Rajeev,

It should be defined as a pre-search rule and not as a business rule.

For better understanding about type of rules, please go through below link:

https://marketing.adobe.com/resources/help/en_US/snp/15.3.1/c_about_rules_menu.html

Thanks!