Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 521181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:13:23+00:00 2026-05-13T08:13:23+00:00

I have a Sitecore content structure where any single item can have a number

  • 0

I have a Sitecore content structure where any single item can have a number of child items that are used to store enumerable content for lists (obviously a fairly standard approach). I am hoping to index these items but store their index data against the parent doc in Lucene. This should hopefully speed up the search bit, by saving time sorting through multiple results which all effectively point to the same URL. Below is some basic code for the custom indexer I will implement.

Can anyone let me know if this is (a) possible and (b) a good idea? The main issues I see are that the Lucene doc already looks like it has been created – do I need to delete it? Also, if the Lucene doc for the parent item does not exist, do I need to create it? And will it be overwritten/lost when the parent item is indexed. Looks like a bit of room of conflict there.

Another option is that I don’t index child items, but get their values when I am indexing the parent. Now that I think about it, this seems like the better way to go.. opinions?

public class CustomIndex : Sitecore.Data.Indexing.Index
{
    public CustomIndex(string indexName): base(indexName) {}

    protected override void AddFields(Item item, Document document)
    {
        //is item a sub-item (promo item)
        if (...)
        {
            //delete the sub-item lucene doc
            DeleteDoc(document); //is this possible or needed?

            //get parent item
            Item parentItem = item.Parent;

            //get lucene document for parent item
            Document parentDoc = GetParentDoc();

            //add fields to parent item lucene document
            parentDoc.Add(...);
            parentDoc.Add(...);
        }
        else
        {
            base.AddFields(item, document);
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:13:23+00:00Added an answer on May 13, 2026 at 8:13 am

    yes i agree, option #2 is better – index the children when you’re at the parent. mainly because you aren’t guaranteed what order the traversal will happen in, so the document may get re-created as you said.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.