Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm wondering if it's possible to boost certain doctypes when performing an examine search? I know I can for all or parts of the search query, but I'd like to implement something that is able to favour, say, news articles over standard content pages. Is that possible with Examine?
My current attempt at working through this is to:
This works well and gives me the desired results, but I'm pretty sure this could be improved from a performance perspective. I'll keep working on it, but would be interested to hear if anyone else had done something similar!
We did something similar but at indexing time by adding a event handler for the DocumentWriting event of your examine indexer.
Something like this
public class BootManager : ApplicationEventHandler
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
var contentIndexer = (UmbracoContentIndexer)ExamineManager.Instance.IndexProviderCollection["IndexerName"];
libraIndexer.DocumentWriting += this.DocumentWriting;
ContentService.Saving += ContentServiceOnSaving;
//MediaService.Saved += MediaServiceSaved;
public void DocumentWriting(object sender, DocumentWritingEventArgs e)
// boost doctype on indexing
if (e.Fields["nodeTypeAlias"] == "YourDocTypeAlias")
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted