U4-6659 - Examine: Specific doctype not being indexed

Created by Richard Terris 26 May 2015, 15:20:20 Updated by Shannon Deminick 05 Jan 2016, 11:38:06

I've had a really strange issue for the last 2 days with Examine.

I created a custom indexset, searcher and indexer but my document type wasn't being indexed, although the index was being created,

Getting the following error in the log file: 2015-05-26 15:56:53,543 [59] ERROR UmbracoExamine.DataServices.UmbracoLogService - [Thread 21] Provider=EventsIndexer, NodeId=-1 System.Exception: Error indexing queue items,System.NullReferenceException: Object reference not set to an instance of an object. at UmbracoExamine.UmbracoContentIndexer.ValidateDocument(XElement node) at Examine.LuceneEngine.Providers.LuceneIndexer.ProcessQueueItem(IndexOperation item, ICollection`1 indexedNodes, IndexWriter writer) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1491 at Examine.LuceneEngine.Providers.LuceneIndexer.ForceProcessQueueItems(Boolean block) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1445, IndexSet: EventsIndexSet

Here's a list of things I tried:

  • renaming the document type alias in the index set configuration, and the actual alias
  • targeting only the id, in case there was an issue with any of the other properties on this doc type
  • tried different analyzers

Here's the REALLY strange thing; if I leave everything the same in the 2 examine config files, but change the targeted doc type to 'generalPage' , then 13 general pages are indexed correctly. If I then change the targeted doc type back to 'eventItem' and recycle the app pool and rebuild the index, then I get back to an empty index.... but, if I add both these doc types as targeted types in the config file, then I get 14 items.

So the workaround seems to be adding a settings node to the index which doesn't have a lot of data and only a single instance, but it is a workaround.

If any more info is required, please let me know.

Comments

Shannon Deminick 27 May 2015, 00:56:36

In order to figure out what is going on we need to replicate it. So you'll need to provide all the steps in order for us to replicate.


Richard Terris 27 May 2015, 08:18:36

Good morning @Shandem

Thanks for the reply.

I don't want to write things which are really obvious and patronising (like 'installed umbraco' or 'created document type') but there isn't anything (to my knowledge) special about this set up. The fact that the document type can be indexed when included alongside another document type is what's most confusing.

To save us both time, could you tell me what things specifically you'd be looking for and I'll provide that detail? Otherwise, if a granular list of steps is best then I'll be happy to provide that.

Let me know.

Thanks, Richard


GaryDevenay 27 May 2015, 10:00:53

@Richard.Terris Would you mind pasting in the config lines from your IndexSet, Indexer and IndexSearcher?


Richard Terris 27 May 2015, 12:08:01

Certainly Mr Gary...

That's it as it currently stands and is working, with the 2 targeted doc types


Richard Terris 02 Jun 2015, 16:16:30

Hi @Shandem

Just wondering if you've had any time to look at this issue and if there's any update at all?

Thanks a lot, Richard


James South 18 Aug 2015, 07:41:02

@Richard.Terris I had a very similar issue running Examine.0.1.65.0. Upgrading to Examine.0.1.68.0 made it go away.


Arjan Hoogervorst 06 Nov 2015, 12:20:20

I'm also seeing this error on a relatively clean install of 7.3.1. I'm '''not''' using any custom index sets, the error comes from the default ExternalIndexSet.

2015-11-06 13:07:54,181 [P11268/D2/T8] ERROR UmbracoExamine.DataServices.UmbracoLogService - Provider=ExternalIndexer, NodeId=-1

System.Exception: Error indexing queue items,System.NullReferenceException: Object reference not set to an instance of an object. at UmbracoExamine.UmbracoContentIndexer.ValidateDocument(XElement node) at Examine.LuceneEngine.Providers.LuceneIndexer.ProcessQueueItem(IndexOperation item, ICollection`1 indexedNodes, IndexWriter writer) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1573 at Examine.LuceneEngine.Providers.LuceneIndexer.ForceProcessQueueItems(Boolean block) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1539, IndexSet: ExternalIndexSet

These are the Examine settings:

  <add name="InternalMemberIndexer" type="UmbracoExamine.UmbracoMemberIndexer, UmbracoExamine"
       supportUnpublished="true"
       supportProtected="true"
       analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>

    <!-- default external indexer, which excludes protected and unpublished pages-->
    <add name="ExternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine" />
  
</providers>
</providers>
{code}

And the Examine indexes:

{code}


Shannon Deminick 19 Nov 2015, 18:08:22

This is fixed. PR for review is here: https://github.com/umbraco/Umbraco-CMS/pull/916

The only way i could replicate this was to create a doc type with a single node in the content tree, if there was more than this amount it would rebuild the index just fine, the issue only occurs with a single content item.


Sebastiaan Janssen 03 Dec 2015, 10:29:29

Unfortunately this was set to "Fixed" before it was actually merged in, so it didn't make it into 7.3.2, sorry about that!


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category: Extensibility

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.2.5, 7.3.1

Due in version: 7.4.0, 7.3.5

Sprint: Sprint 3

Story Points:

Cycle: