Had a legit request from a client that they want the parent nodes to come higher up the rankings than any children which might contain the same searched for phrase/word. So give this tree:
Cars - Ford - VW - Lada
if searching for "engine" (which lets say all pages contain) they want to have the "Cars" node listed first. Note this "weighting" might not be based on the tree position so we thought if we could adjust the weighting per doctype (in this example "Cars" is a different doctype than the child manufactures)?
Examine, can you change weightings of doctypes?
Had a legit request from a client that they want the parent nodes to come higher up the rankings than any children which might contain the same searched for phrase/word. So give this tree:
Cars
- Ford
- VW
- Lada
if searching for "engine" (which lets say all pages contain) they want to have the "Cars" node listed first. Note this "weighting" might not be based on the tree position so we thought if we could adjust the weighting per doctype (in this example "Cars" is a different doctype than the child manufactures)?
Cheers
Pete
check this post for some info that may help:
http://our.umbraco.org/forum/developers/extending-umbraco/33325-Boosting-examine-fields-during-indexing
a little snippet (doesn;t do it based on doctype, but may help):
this has the boost value for the document on a doc property. (untested but gives you an idea).
I'm not sure you can get the doctype (or any node data for that matter) at Document Writing time but am quite possibly wrong :-)
var indexer = (UmbracoContentIndexer)ExamineManager.Instance.IndexProviderCollection["indexname"];
indexer.DocumentWriting += indexer_DocumentWriting;
}
void indexer_DocumentWriting(object sender, Examine.LuceneEngine.DocumentWritingEventArgs e)
{
var field= e.Document.GetField("BoostScore");
e.Document.SetBoost(float.Parse(field.ToString()));
}
is working on a reply...