I can't configure the wpsolr boost by post type

Tagged:
  • moisb
    Participant
    4 years, 7 months ago #14396

    Hello, I have 3 types of posts indexed on Solr (I use Solr 7 via OPenSolr). Are they: “post” (wordpress default), coupon (custom post type) and product (woocommerce). The “product” comes from another wordpress site (I use global search/cross search).

    I’m trying to do it like this (https://snipboard.io/VJs9Wy.jpg):
    Boost factor = 2
    Boost Values =
    coupon^2
    product^0.5
    post^0.4

    I want the custom post type “coupon” to be shown first in the results when a searched word also finds results in other post types.

    but when I activate all searches return empty 🙁

    How I do?
    After setting the boost do I need to reindex all data?

    wpsolr
    Keymaster
    4 years, 7 months ago #14397

    You need to select other fields also, else your search is only looking into the field “type”.

    moisb
    Participant
    4 years, 7 months ago #14398

    hi Patrice, could you show me an example? I am confused about how I should do it.

    And after setting the boost do I need to reindex all data?

    wpsolr
    Keymaster
    4 years, 7 months ago #14399

    Just add the fields you want to search into, as you did for field “type”. But you do not need to add boost values for the other fields. You can use a boost factor of “1”.

    No, changing boosts do not require reindexing.

    moisb
    Participant
    4 years, 7 months ago #14402

    OK. Now I understand 🙂 However, I’m still doing a test search using a keyword that has records on “product” and “coupon”. And even with the higher boost for type “coupon”, they are returning results of type “product” at the first positions.

    I will send you an email with all the details. If you can help me by saying what I am doing wrong, I am grateful.

    P.S: if you can help me adjust this you can add my site (I use 2 licenses with cross search) as a portfolio for WPSolr. I love your plugin.

    wpsolr
    Keymaster
    4 years, 7 months ago #14403

    Please send me a screenshot of your screen 2.3

    PS: create another topic for cross search questions

    moisb
    Participant
    4 years, 7 months ago #14404
    wpsolr
    Keymaster
    4 years, 7 months ago #14405

    Are you sure “coupon” is the post type name? Can you check in Solr admin?

    • This reply was modified 4 years, 7 months ago by wpsolr.
    wpsolr
    Keymaster
    4 years, 7 months ago #14419

    Similar issue in Boost pages over media (PDFs). Can you check that your WPSOLR version is up to the latest version?

    moisb
    Participant
    4 years, 7 months ago #14422

    Yes, I’m sure about the name of the post type “coupon”. I just checked by running a query in Solr admin:

    “type”:”coupon”,
    “meta_type_s”:”post_type”,

    Solr Version: 7.0
    WPSOLR PRO: 21.6

    wpsolr
    Keymaster
    4 years, 7 months ago #14423

    Fine.

    Try a search without keywords.

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

You must be logged in to reply to this topic.