In Umbraco 8 i am trying to get search to work.
I have followed the documentation, but i am givin no result.
If i test searching in the backoffice, it works fine.
My search code:
if (ExamineManager.Instance.TryGetIndex("ExternalIndex", out var index))
{
var searcher = index.GetSearcher();
var results = searcher.CreateQuery("content", BooleanOperation.Or)
.Field("pageTitle", searchTerm)
.Or().Field("subPagetitle", searchTerm)
.Or().Field("grid", searchTerm)
.Execute();
var r = results;
}
var examineManager = Current.Factory.GetInstance<IExamineManager>();
IIndex index;
if (!examineManager.TryGetIndex( "ExternalIndex", out index ))
{
return null;
}
return index.GetSearcher().Search( searchString );
This is exactly the code used by the Umbraco ExamineManagementController. But it doesn't give me any results. In the backoffice the queries work, but my code doesn't. If I use the same code with the InternalIndex, it works.
Examine search return no results
In Umbraco 8 i am trying to get search to work. I have followed the documentation, but i am givin no result. If i test searching in the backoffice, it works fine.
My search code:
Can anyone see what i am doing wrong ?
Did you find a solution for this problem?
I tried the simplest possible solution:
This is exactly the code used by the Umbraco ExamineManagementController. But it doesn't give me any results. In the backoffice the queries work, but my code doesn't. If I use the same code with the InternalIndex, it works.
Hey there, future here!
Did any of you find any solution for this?
With Umbraco 9 / 10 this behavior seems to be gone.
is working on a reply...