Boost pages over media (PDFs)

Tagged:
  • DarrenPotter
    Participant
    4 years, 5 months ago #14408

    Hi,

    PDFs are dominating my search results a little too much. Can I use type to boost pages or give media files less weighting? If so, how do I do that?

    Darren

    wpsolr
    Keymaster
    4 years, 5 months ago #14409

    Of course, yes.

    Use boost values on field “type” like:
    attachment^.5
    page^1

    (tested on my local env)

    Image wpsolr-boost-pdfs.png of

    DarrenPotter
    Participant
    4 years, 5 months ago #14412

    Thanks for the reply. I tried it exactly as you showed it but the search broke and I got the following message:

    Solr HTTP error: OK (400) {“error”:{“metadata”:[“error-class”,”org.apache.solr.common.SolrException”,”root-error-class”,”org.apache.solr.parser.TokenMgrError”],”msg”:”org.apache.solr.search.SyntaxError: Cannot parse ‘type:\”attachment\”^.5 type:\”page\”^1’: Lexical error at line 1, column 19. Encountered: \”.\” (46), after : \”\””,”code”:400}}

    wpsolr
    Keymaster
    4 years, 5 months ago #14413

    Which Solr version is it?

    Can you try:
    attachment^1
    page^2

    DarrenPotter
    Participant
    4 years, 5 months ago #14414

    It’s WPSOLR PRO 19.5.

    I tried those values. The search didn’t break this time but I’m not seeing any difference, even when I tried some pretty extreme boosts e.g.

    attachment^1
    page^3000

    wpsolr
    Keymaster
    4 years, 5 months ago #14415

    Your Apache Solr version?

    wpsolr
    Keymaster
    4 years, 5 months ago #14416

    Mea culpa, I made my previous tests with Elasticsearch.

    So, now with Solr, I confirm that partial decimals notation like “.5” crashes. One need to use “0.5”

    So, the previous example should have been (for Solr):

    attachment^0.5
    page^1

    But then, on my local env, the boosts work as expected, and PDFs are displayed after pages in results.

    wpsolr
    Keymaster
    4 years, 5 months ago #14418

    WPSOLR PRO 19.5 is very old. Please update it, your issue could have been fixed in later versions.

    DarrenPotter
    Participant
    4 years, 5 months ago #14420

    Thanks for the quick replies; I’ve managed to improve the results. Will look into upgrading!

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.