Gravatar for

Question by Bruce.Hamilton, Apr 3, 2018 1:27 PM

Indexing Angular JS pages

I found a previous question related to Angular JS pages:

Index pages loaded dynamically with angularjs

but it looks like it went cold around November 2016.

Can Coveo for Sitecore be set up to crawl / index pages build on Angular JS?

1 Reply
Gravatar for

Answer by Jean-François L'Heureux, Apr 3, 2018 1:48 PM

The previous question you found was not regarding the Coveo for Sitecore solution. It was regarding the Coveo web crawler. This crawler is not used by Coveo for Sitecore.

Coveo for Sitecore can index the rendered HTML of Sitecore items with an AngularJS layout and components only if the Sitecore instance is server-side rendering the pages on first load (on a GET request to the page itself).

Coveo for Sitecore indexes the rendered HTML of Sitecore page items by sending an HTTP request to get the HTML. If the page is not server-side rendered, only the app placeholder markup will be indexed as Coveo for Sitecore is not running the JavaScript code after getting the HTTP response.

If server-side rendering is not possible, you could always write your own `coveoPostItemProcessingPipeline` processor to replace the out of the box `HtmlContentInBodyWithRequestsProcessor` or `FetchPageContentProcessor`. Your custom processor would have to use a tool like PhantomJS or Headless Chrome or Puppeteer to render the page, run the JavaScript code and copy the DOM to set the `CoveoIndexableItem`'s `BinaryData` property.

Gravatar for

Comment by Bruce.Hamilton, Apr 3, 2018 1:56 PM

Thank you @Jean-François L'Heureux for the response.

I should have expanded on / clarified my question a bit more before clicking submit.

The bulk of our site is Sitecore, the Angluar pages I am trying to index via Coveo however, are built outside of Sitecore. I have been attempting to index them as a "web source". Does your answer still apply or does that change things?

For reference, the pages are : Destinations

Gravatar for

Comment by Bruce.Hamilton, Apr 3, 2018 2:00 PM

Pro Cloud

Ask a question