Gravatar for

Question by jimschram, Jun 22, 2015 2:19 PM

Sitecore Inbound Filtering: Is it possible to apply different rules based on different indexes?

We have multiple indexes with different crawler roots. Depending on the index being updated, we would like to be able to filter out items by URL, Title, etc.

We have a single indexing.filterIndex.inbound pipeline processor currently defined that executes on every item and any index.

So the question is how can we retrieve the current index context during an inbound filter process to apply different rules? Or maybe apply different inbound filter pipeline processors to different indexes?

Thanks, Jim

1 Reply
Gravatar for

Answer by Simon, Jun 22, 2015 2:47 PM

See the code snippet at the end of this help page:

It shows how to filter by index name, so you could had your logic in that condition. Alternatively, you could also grab the context database of the item.

Hope it helps

Gravatar for

Comment by jimschram, Jun 22, 2015 4:54 PM

Thanks Simon,

Unfortunately the arguments for the corresponding pipeline processor for indexing.filterIndex.inbound are of type InboundIndexFilterArgs which does not include an index property as mentioned in your example above.

I've also tried using CoveoIndexFetcher.GetCoveoSearchIndex(IIndexable) but it also returns the first configured index with the same database.

As of now we have 4 different indexes that are responsible for indexing different areas of the content tree, but all four use the web database. We've had discussions internally about consolidating into the default web index, but that would result in some refactoring that we don't really want to take on over the next couple weeks.

Thanks again for your help, Jim

Gravatar for

Comment by Simon, Jun 22, 2015 5:33 PM

I see, the issue here is that all of your indexes are using the same DB. I would say that merging all indexes under one would be the best practice.

In the meantime, you could filter on template or content start path. Filtering by index name will not be possible.

Ask a question