0
votes

When using Lucene indexing in Sitecore, is it possible to add items to an index based on the content of an item? Indexes can be built based on template id but I would like to add additional criteria to filter items before they are added to the index.

1

1 Answers

1
votes

I am not sure exactly what you mean. The headline seems different than the body?

Anyways, from the actual question, I understand that you'd like to add items only if a given criteria is meet? It could for instance be - only add items that are based on template X.

As far as I know, the responsibility for getting data for the index lies with the ItemCrawler. The standard ItemCrawlers are based on paths (e.g. everything under /Sitecore/home is indexed). I am thinking you could make your own ItemCrawler and use that in your index instead.

Here are some examples of a custom item crawlers:

http://mityasctech.blogspot.com/2016/10/create-custom-sitecore-search-crawler.html http://mrstevenzhao.blogspot.com/2014/04/sitecore-custom-item-crawler.html

I hope this can help you.