With Lucene it's possible to boost documents and fields at indexing time instead of at search time.
You could write a custom indexer derived from UmbracoExamine.UmbracoContentIndexer. In overridden methods OnDocumentWriting and OnGatheringNodeData you'd check the type of document and set the boost value like you do above. However, those documents will always be boosted no matter what kind of search you do. But I imagine that's what you're after. Otherwise, you can always just add another index and use that one for this search.
This search on google will give you a lot more input. :)
Lucene/Examine: Boost document based on doctype?
In lucene is it possible to boost a document based on doctype without using the doctype field for searching?
I'm currently using a RawQuery:
{ SearchIndexType: , LuceneQuery: (+(nodeName:business^20.0 ((+nodeName:business~0.5)^15.0) nodeName:business~0.5^10.0 urlName:business^20.0 ((+urlName:business~0.5)^15.0) urlName:business~0.5^10.0 umbracoUrlAlias:business^20.0 ((+umbracoUrlAlias:business~0.5)^15.0) umbracoUrlAlias:business~0.5^10.0 umbracoUrlName:business^20.0 ((+umbracoUrlName:business~0.5)^15.0) umbracoUrlName:business~0.5^10.0 metaTitle:business^20.0 ((+metaTitle:business~0.5)^15.0) metaTitle:business~0.5^10.0 metaDescription:business^20.0 ((+metaDescription:business~0.5)^15.0) metaDescription:business~0.5^10.0 metaTags:business^20.0 ((+metaTags:business~0.5)^15.0) metaTags:business~0.5^10.0 promoHeadline:business^20.0 ((+promoHeadline:business~0.5)^15.0) promoHeadline:business~0.5^10.0 promoSummary:business^20.0 ((+promoSummary:business~0.5)^15.0) promoSummary:business~0.5^10.0 contentHeadline:business^16.0 ((+contentHeadline:business~0.5)^11.0) contentHeadline:business~0.5^6.0 contentHeadlineExtra:business^16.0 ((+contentHeadlineExtra:business~0.5)^11.0) contentHeadlineExtra:business~0.5^6.0 contentBody:business^11.0 ((+contentBody:business~0.5)^6.0) contentBody:business~0.5 about:business^11.0 ((+about:business~0.5)^6.0) about:business~0.5 additionalResources:business^11.0 ((+additionalResources:business~0.5)^6.0) additionalResources:business~0.5 email:business^11.0 ((+email:business~0.5)^6.0) email:business~0.5 office:business^11.0 ((+office:business~0.5)^6.0) office:business~0.5 phone:business^11.0 ((+phone:business~0.5)^6.0) phone:business~0.5 titles:business^11.0 ((+titles:business~0.5)^6.0) titles:business~0.5 propSearchHide:business^11.0 ((+propSearchHide:business~0.5)^6.0) propSearchHide:business~0.5) +propSearchHide:0) }
With Lucene it's possible to boost documents and fields at indexing time instead of at search time.
You could write a custom indexer derived from
UmbracoExamine.UmbracoContentIndexer
. In overridden methodsOnDocumentWriting
andOnGatheringNodeData
you'd check the type of document and set the boost value like you do above. However, those documents will always be boosted no matter what kind of search you do. But I imagine that's what you're after. Otherwise, you can always just add another index and use that one for this search.This search on google will give you a lot more input. :)
http://www.google.com/search?q=umbraco+examine+custom+indexer
(Basically, write some code and modify config/examinesettings.config)
Thanks, Lars. I ended up using the Epiphany SearchBoost package. So far it seems to be working nicely. Good information for the future though.
Thanks again.
is working on a reply...