Search & Promote Query to fetch content based on dates

rajeev_bose

15-10-2015

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.

Accepted Solutions (1)

Accepted Solutions (1)

Answers (3)

Answers (3)

rajeev_bose

15-10-2015

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

shekhardhiman

Employee

15-10-2015

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!

shekhardhiman

Employee

15-10-2015

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