Reputation: 1
I have been having an issue where Indexes for Search have been failing for a while it seemed like new indexes weren't getting created. I went to rebuild the Search index using that rebuild button, and all the documents that were previously indexed were no longer indexed.
I followed this article without results: Orchard - Search & Indexing issue
This did not work. I think probably because
App_data\Sites\Default\Search.settings.xml
doesn't get generated in the first place. I do however see a file:
App_data\Sites\Default\Search.settings.xml.lock
I believe the Orchard.Indexing.Services.IndexingTaskExecutor UpdateIndexBatch method is failing because my impression is the lock file would be created and then deleted if it was working. Here is a possibly relevant error:
2021-01-08 00:00:41,174 [48] Orchard.Exceptions.DefaultExceptionPolicy - Default - An unexpected exception was caught (null) System.NullReferenceException: Object reference not set to an instance of an object. at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options, QueryHints hints) at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options) at Orchard.Indexing.Services.IndexingTaskExecutor.b__0(ContentItemVersionRecord versionRecord) at System.Linq.Enumerable.WhereSelectListIterator
2.MoveNext() at System.Linq.Enumerable.<DistinctIterator>d__64
1.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable
1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Orchard.Indexing.Services.IndexingTaskExecutor.BatchIndex(String indexName, String settingsFilename, IndexSettings indexSettings) at Orchard.Indexing.Services.IndexingTaskExecutor.UpdateIndexBatch(String indexName) at Orchard.Indexing.Services.UpdateIndexScheduler.UpdateIndex(String indexName) at Orchard.Events.DelegateHelper.<>c__DisplayClass2b
2.b__2a(Object target, Object[] p) at Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String messageName, String interfaceName, String methodName, IDictionary2 arguments, IEnumerable& returnValue) at Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary
2 eventData, IEnumerable& returnValue)
Another error I see that I believe is related to the issue seems to occur in Orchard.Indexing.Handlers.InfosetFieldIndexingHandler
2021-01-08 00:00:02,236 [48] Orchard.ContentManagement.DefaultContentManager - Default - NullReferenceException thrown from IContentHandler by Orchard.Indexing.Handlers.InfosetFieldIndexingHandler (null) System.NullReferenceException: Object reference not set to an instance of an object. at Orchard.Fields.Fields.DateTimeField.get_DateTime() at Orchard.Fields.Drivers.DateTimeFieldDriver.b__15(DateTimeField field) at Orchard.ContentManagement.Handlers.DescribeMembersContext.Enumerate[TField](Func
1 enumerate) at Orchard.Fields.Drivers.DateTimeFieldDriver.Describe(DescribeMembersContext context) at Orchard.ContentManagement.Drivers.ContentFieldDriver
1.Orchard.ContentManagement.Drivers.IContentFieldDriver.Describe(DescribeMembersContext context) at Orchard.Indexing.Handlers.InfosetFieldIndexingHandler.<.ctor>b__0(IndexContentContext context, InfosetPart cp) at Orchard.ContentManagement.Handlers.ContentHandler.InlineStorageFilter1.Indexing(IndexContentContext context, TPart instance) at Orchard.ContentManagement.Handlers.StorageFilterBase
1.Orchard.ContentManagement.Handlers.IContentStorageFilter.Indexing(IndexContentContext context) at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.Indexing(IndexContentContext context) at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass99.b__97(IContentHandler handler) at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable1 events, Action
1 dispatch, ILogger logger)
To note, I did try to generate a new index and just have it index news articles. This did not work, or generate the settings.xml file either.
Is there a database location that I should be looking at that could be containing null dates, or should I be looking elsewhere? Any help would be greatly appreciated.
Edit: It has been two days and no responses, so I made a post with updated details on git (in case someone is looking for an answer to the same question, and in case git hub has an answer git hub issue)
Upvotes: 0
Views: 73
Reputation: 1
The solution was found. There was some null data within ContentItemRecord. The null Data and ContentType_id resulted in no indexes being built even unrelated index.
Here is the query we used to find the bad data. The xxxxxx would need to be replaced by whatever prefix is associated with your table, but gives you an idea what to do.
SELECT *
FROM [dbo].[xxxxxx_Orchard_Framework_ContentItemVersionRecord] civr
LEFT JOIN [dbo].[xxxxxx_Orchard_Framework_ContentItemRecord] cir ON civr.ContentItemRecord_id = cir.Id
LEFT JOIN [dbo].[xxxxxx_Orchard_Framework_ContentTypeRecord] ctr ON cir.ContentType_id = ctr.Id
WHERE cir.Id IS NULL OR cir.Data IS NULL OR ctr.Id IS NULL
Upvotes: 0