November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Yes, you can basically index any data in Find: https://world.episerver.com/documentation/developer-guides/find/NET-Client-API/Indexing/
In your case you need a list of all the items you want to index, and you could create a scheduled job that index all press releases.
Another option that I've used in these kind of scenarios, is to create pages in Episerver and fill them with data from the press releases. That way you atutomatically get a nice SEO friendly url. But if there are thousands of press releases that might not be the best approach.
Hi Erik,
I am considering your second option to create news page programmtically since the website has around 100 press releases.
Thanks for the tips!
Hi guys,
In a project, I have built a news archive page type and a news page type in CMS for showing the press releases.
The data that shows on a news page get from a api (with querystring parmeter in url Http://locallsot:17000/news/?item_id=123456&type_of_media=news)
My question is how can I index the data in Find? The data gets directly from api and send to frontend in a reach compoent.
string xmlStr;
using (var wc = new WebClient())
{
wc.Encoding = Encoding.UTF8;
xmlStr = wc.DownloadString(Api);
}
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlStr);
var item = new News();
foreach (XmlNode node in doc.SelectNodes("item"))
{
item.Header = node.SelectSingleNode("header").InnerText;
item.PublishDate = node.SelectSingleNode("published_at").InnerText;
item.Body = node.SelectSingleNode("body").InnerText;
if (node.SelectSingleNode("image") != null)
item.Image = node.SelectSingleNode("image").InnerText;
News = item;
}
public News news { get; set; }
Thanks!