Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan White 206 posts 510 karma points c-trib
    Oct 16, 2013 @ 18:07
    Dan White
    0

    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) }
  • Lars-Erik Aabech 349 posts 1100 karma points MVP 8x c-trib
    Oct 19, 2013 @ 11:19
    Lars-Erik Aabech
    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 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. :)

    http://www.google.com/search?q=umbraco+examine+custom+indexer

    (Basically, write some code and modify config/examinesettings.config)

  • Dan White 206 posts 510 karma points c-trib
    Oct 23, 2013 @ 18:00
    Dan White
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft