Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James Cordrey 11 posts 113 karma points
    Mar 01, 2023 @ 01:14
    James Cordrey
    0

    Custom Index Issue

    So, this is a bit of a weird one. Currently running Umbraco V11.1.0

    When I set my composer up like this:

    builder.Services.ConfigureOptions<ConfigureEntwinedStudiosIndexOptions>();
    builder.Services.AddExamineLuceneIndex<EntwinedStudiosIndex, ConfigurationEnabledDirectoryFactory>("EntwinedStudiosIndex");
    builder.Services.AddSingleton<EntwinedStudiosIndexValueSetBuilder>();
    builder.Services.AddSingleton<IIndexPopulator, EntwinedStudiosIndexPopulator>();
    

    My index populates, but the options I've configured in the ConfigureEntwinedStudiosIndexOptions class are ignored. (Specifically published content is set to false, and itemTypes are not present.)

    When I set my composer up like this:

    builder.Services.AddExamineLuceneIndex<EntwinedStudiosIndex, ConfigurationEnabledDirectoryFactory>("EntwinedStudiosIndex");
    builder.Services.ConfigureOptions<ConfigureEntwinedStudiosIndexOptions>();
    builder.Services.AddSingleton<EntwinedStudiosIndexValueSetBuilder>();
    builder.Services.AddSingleton<IIndexPopulator, EntwinedStudiosIndexPopulator>();
    

    The index shows all the options I expect it to, but nothing gets indexed.

    When content is indexed, this is what I see:

    enter image description here

    This is what I see under the second composer configuration:

    enter image description here

    I was following along at this link to try and figure out what I did wrong - but even when I set things up exactly the way this link has, I get the above results.

    I can probably live with using default indexing options if I need to, but I'd like to know if I'm doing something wrong here. I'm new to Examine and Index Manipulation.

    Thanks!

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Mar 01, 2023 @ 09:02
    Huw Reddick
    1

    I just checked my custom index (which is working) it would appear I have removed the builder.Services.ConfigureOptions line, unsure why, but the index does work.

        builder.Services.AddExamineLuceneIndex<ForumIndex, ConfigurationEnabledDirectoryFactory>("ForumIndex");
    
        builder.Services.AddSingleton<ForumIndexValueSetBuilder>();
    
        builder.Services.AddSingleton<IIndexPopulator, ForumIndexPopulator>();
    

    enter image description here

  • James Cordrey 11 posts 113 karma points
    Mar 01, 2023 @ 12:20
    James Cordrey
    0

    Yeah, I tried that too - it indexes, but it appears to have the base configuration for an index, which is all document types and unpublished content.

    Which I could work around, but I'd rather know how to make the configuration options work.

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Mar 01, 2023 @ 13:44
    Huw Reddick
    1

    I'll have a play later see if I can get anywhere :)

  • James Cordrey 11 posts 113 karma points
    Mar 01, 2023 @ 13:50
    James Cordrey
    0

    I appreciate that!

Please Sign in or register to post replies

Write your reply to:

Draft