Using Umbraco Examine for my latest Umbraco 8 site has given me a problem I don't seem to be able to solve on my own. The requirements for the site include that a number of custom database tables should be searchable. I have implemented this in accordance with the instructions on
this page:
... and it works fine. But I also have to rebuild the custom index programmatically at certain times, and it needs to happen
in a new thread or using Async/Await. Unfortunately, the objects in IndexPopulator are in those cases set to null (in the PopulateIndexes method).
So:
_indexRebuilder.RebuildIndex([indexname])
...works under normal circumstances, but in a new thread or with Async/Await an "Object reference not set ..." error is raised.
Thanks for trying to help, David. I have done some googling and testing based on your suggestions, but no one is going anywhere. I still get the NullReferenceException in the IndexPopulator.
Note again that I have no problem rebuilding my custom index programmatically the Umbraco 8 way - in the main thread. The error occurs when trying to do it from within a new thread or asynchronously. Which I have to.
Rebuild Index issue
Hi,
Using Umbraco Examine for my latest Umbraco 8 site has given me a problem I don't seem to be able to solve on my own. The requirements for the site include that a number of custom database tables should be searchable. I have implemented this in accordance with the instructions on this page:
https://skrift.io/issues/examine-in-umbraco-8/
... and it works fine. But I also have to rebuild the custom index programmatically at certain times, and it needs to happen in a new thread or using Async/Await. Unfortunately, the objects in IndexPopulator are in those cases set to null (in the PopulateIndexes method).
So:
...works under normal circumstances, but in a new thread or with Async/Await an "Object reference not set ..." error is raised.
Anyone who knows how to handle this problem?
/Jan
Hi,
I think I remember Umbraco 7 used to have a public url that rebuilds the index. I wonder if Umbraco 8 still has this.
Maybe you could do an async web request to this url and have more luck.
If not then maybe you could create an APIController that handles the rebuild then do the same. Call this in a web request.
Regards
David
Thanks for trying to help, David. I have done some googling and testing based on your suggestions, but no one is going anywhere. I still get the NullReferenceException in the IndexPopulator.
Note again that I have no problem rebuilding my custom index programmatically the Umbraco 8 way - in the main thread. The error occurs when trying to do it from within a new thread or asynchronously. Which I have to.
/Jan
is working on a reply...