Closed sasetkaKmd closed 1 year ago
Why are you creating a custom index implementation? Why not just filter items that are not "contentPage" with events or validators?
@Shazwazza We got things running.
We need a custom index for virtual pages(pages powered by external content with no content node). I would like for virtual pages to go into ExternalIndex
, but I lack knowledge about how to go on about that.
@hallojoe I see. In that case you must have a mechanism for keeping the external content in-sync with the index? - I hope you aren't rebuilding the index each time just to keep it in sync? The Examine API that is used to push data to the index is IIndex.IndexItems
. I assume this is what you are using for your custom index but in that case, you can just push this data to the External index but will need to make sure that the document ID doesn't overlap with an existing Umbraco INT Id.
Hi @hallojoe, can I go ahead and close this ticket? Can you describe how you got it working and what the underlying issue was?
@Shazwazza This can be closed. I cannot point out the exact problem related to this issue. I believe that @sasetkaKmd ran into the issue of "no analyzer set by default" as described in #71. We needed a custom content index for virtual pages, and I managed to write code to do so. Looking forward to trying out 4.0 RTM
.
My code that works on Examine and show documents, but on ExamineX I got exception
System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=ExamineX.AzureSearch.Umbraco StackTrace: at ExamineX.AzureSearch.Umbraco.UmbracoAzureSearchContentIndex.A(ValueSet ) at System.Linq.Lookupd__17.MoveNext()
at ExamineX.AzureSearch.Umbraco.UmbracoAzureSearchContentIndex.PerformIndexItems(IEnumerable
2.Create(IEnumerable
1 source, Func2 keySelector, IEqualityComparer
1 comparer) at System.Linq.GroupedEnumerable2.ToArray() at System.Linq.Buffer
1..ctor(IEnumerable1 source) at System.Linq.OrderedEnumerable
1.1 values, Action
1 onComplete) at Umbraco.Core.Search.Indexes.CustomIndex.Examine.IIndex.IndexItems(IEnumerable1 values) in C:\Umbraco.Core\Search\Indexes\CustomIndex.cs:line 43 at Umbraco.Cms.Infrastructure.Examine.ContentIndexPopulator.IndexAllContent(Int32 contentParentId, Int32 pageIndex, Int32 pageSize, IReadOnlyList
1 indexes) at Umbraco.Cms.Infrastructure.Examine.ContentIndexPopulator.PopulateIndexes(IReadOnlyList`1 indexes) at Umbraco.Cms.Infrastructure.Examine.IndexPopulator.Populate(IIndex[] indexes) at Umbraco.Cms.Infrastructure.Examine.ExamineIndexRebuilder.RebuildIndexes(Boolean onlyEmptyIndexes, TimeSpan delay, CancellationToken cancellationToken)There should be 22 documents.
Could you help me with this?