Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
Hi Marko,
Sounds very strange. What happens if you don't add the filters? Also, can you see the pages with values for Notification in the index (in the Explore view in Find's shell module)?
Hi,
I left filters out and results are the same, nothing gets returned. I can see that pages are indexed in the Explorer view.
I have another search routine to get station names for autocomplete list. This works perfectly but this calls GetResult() instead of GetContentResult()
public IEnumerable<string> GetAutocompleteList(string query)
{
var stationQuery = SearchClient.Instance.Search<StationPage>();
foreach (var word in query.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries))
{
stationQuery = stationQuery.Filter(f => f.Name.AnyWordBeginsWith(word));
}
return stationQuery
.OrFilter(f => f.StationFolderName.AnyWordBeginsWith(query))
.Select(f => f.Name)
.StaticallyCacheFor(TimeSpan.FromHours(1))
.GetResult();
}
Hmm, could you inspect the result prior to using the Select method? Ie while debugging or in some other way.
As the Select method in the code you posted is applied after getting the result from the search engine I have a hard time seeing how the value in Notification could change what the search engine returns.
I'll try that but can't do that just now. I'll get back to this next week.
Hello again,
Now this is weird. I changed that particular property to be string type so I could get some work done. This morning I decided I'll try to debug this and changed it back to XhtmlString and ... now it works! I can't reproduce the error anymore.
Btw I stumbled another weird problem which might be related to this or not. When I changed property type from string->XhtmlString page type builder (or whatever it is called in Epi7) "forgot" to generate code for it. I got MissingMethodException saying that there's no get_Notification() method after installing (or in fact, installations are done automatically by scripts) application to our CI server. I forced another installation without any changes and magically exception went away.
Hi,
Given what you last wrote and seeing as you got the original exception after you had executed the search, in the Select after GetContentResult, my guess is that the problem actually has to do with something weird going on with the CMS/typed pages. I think what happend is your search executed and the search engine returned references to matching pages. Then GetContentResult tried to fetch the pages for you and you did a projection webserver side. Somewhere in the last step an exception was thrown due to the issues with method's not being generated and GetContentResult's error handling "swallowed" them making it seem like you didn't get any hits.
That's just a guess though, but I think it makes sense considering the new facts in the case :)
I'm getting the same bug to with Xhtml properties
model.Results = SearchClient.Instance.Search<ProductBlock>().For(searchTerm).InField(x => x.MainNarrative.ToString()).GetContentResult();
returns no results but using filter does
model.Results = SearchClient.Instance.Search<ProductBlock>().Filter(x => x.MainNarrative.AnyWordBeginsWith(searchTerm)).GetContentResult();
Not sure if unified search would work better. Any tips anyone. Am I doing something I shouldn't?
To be honest I'm close to raising this as a bug - we are a bit worried about it over here. Even if it is an intermittent problem its a serious concern for us. I'll leave this up for a bit before rasiing. It's possible I've just missed something obvious. But the search being broken with XHtml strings will stop the implementation in it's tracks
Cheers
Try changing
.InField(x => x.MainNarrative.ToString())
to
.InField(x => x.MainNarrative)
Thank you for that - that actually works. There is still a samll bug where
.InFields(x => x.LongSummary.ToString(), x => x.MainNarrative.ToString())
doesn't work with XHtml fields but I can live with that. Thanks
Skip the ".ToString()" there as well when specifying the InFields.
/Henrik
Hello,
I was playing around with Epi Find and stumbled to a situation where Find doesn't return pages where I have XhtmlString properties. Here's a snippet from the page type.
And search routine
}
Now the search works fine with Station-pages which Notification property is empty. If I insert any text to it search doesn't return it or any other Station-page which might be the result of the search.
Is this a bug or am I doing something wrong?
-Marko