Im using ExternalIndex to fetch all my nodes. And it works all great now, but i can’t seem to propperly also index unpublished nodes aswell.
if (!_examineManager.TryGetIndex("ExternalIndex", out var index)) return NotFound();
var searcher = index.Searcher;
var query = searcher.CreateQuery("content").NodeTypeAlias("eventPage");
var totalSearchResults = query.Execute(QueryOptions.SkipTake(0, 9999));
in /umbraco/#/settings?dashboard=settingsExamine
all i can see is PublishedValuesOnly = true, but i want it to be false. But can’t find the right way to do it.
The external index is meant for published content, not for unpublished content. Also, if you put unpublished content in the published index, you might expose unpublished data. I suggest you use the internal index if you want all data.
But let’s take a step back, what do you want to accomplish?
Well makes sense, i was only jsut getting into querying the nodes by this way.
So if i were to use Internal instead i should edit would it be enough to change the index, like this?
if (!_examineManager.TryGetIndex("InternalIndex", out var index)) return NotFound();
What i want to do.
I have a case where i want to render out the current pages that belongs to a user.
That works all fine with the give code in the post before. But the user also have an option, where the can “Save and publish” later. So when they do that, i unpublish the page and just “Save” it, not publish. So in the ExternalIndex, they are just gone from the page after that. not being counted in as the result.