Sunday, July 27, 2014

Attachments | Out of the box are not crawled | enable searching

Once attachments are created in CMC and assigned to respective products, schedule job ScheduledContentManagedFileEARUpdate picks them up and moves them into Stores\\attachments folder. By default this job could be configured to run for 30 minutes so on dev, you will need to configure to run quicker to test.

Out of the box attachments are not picked and hence you pick up the static file below StaticContentSitemap.jsp and add the block below to read all attachments to be crawled

-----------------------------------------------------------------------------------------------------------
<wcbase:useBean id="attachmentBean" classname="com.ibm.commerce.catalog.beans.AttachmentDataBean" scope="page">
<c:set value="${langId}" target="${attachmentBean}" property="languageId"/>
</wcbase:useBean>
<c:forEach var="attachmentAssetDataBean" items="${attachmentBean.attachmentAssets}">
<c:set var="tempURL" value="/${attachmentAssetDataBean.directory}/${attachmentAssetDataBean.attachmentAssetPath}"/>
<c:set var="attachmentURL" value="${fn:replace(tempURL, ' ', '%20')}"/>
<url crawlurl="${attachmentURL}" indexurl="${attachmentURL}">
</c:forEach>
-----------------------------------------------------------------------------------------------------------

You can run the build index and Crawler by running this command: from \bin

di-buildindex.bat -masterCatalogId 10001 -webcontentDelete true

crawler.bat -cfg C:\WCDE_ENT70\search\solr\home\droidConfig.xml



Configure the crawler file for the store : droidConfig.xml
-----------------------------------------------------------------------------------------------------------
<variables> 
<var name="hostname">localhost</var> 
<var name="storePathDirecttory">/WCDE_ENT70/wasprofile/temp/localhost/server1/WC/EliteStorefrontAssetStore</var> 
<var name="langId">-1</var> 
<var name="storeId">10151</var> 
<var name="catalogId">10001</var> 
<var name="language">en</var> 
<var name="localename">en_US</var>
<var name="filterDir">/WCDE_ENT70/search/solr/home</var> 
<var name="port">80</var> 
</variables>
-----------------------------------------------------------------------------------------------------------

No comments:

Post a Comment