I can't configure the wpsolr boost by post type

  • moisb
    Participant
    # 2 months, 1 week ago

    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
    # 2 months, 1 week ago

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

    moisb
    Participant
    # 2 months, 1 week ago

    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
    # 2 months, 1 week ago

    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
    # 2 months, 1 week ago

    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
    # 2 months, 1 week ago

    Please send me a screenshot of your screen 2.3

    PS: create another topic for cross search questions

    moisb
    Participant
    # 2 months, 1 week ago
    wpsolr
    Keymaster
    # 2 months, 1 week ago

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

    • This reply was modified 2 months, 1 week ago by  wpsolr.
    wpsolr
    Keymaster
    # 2 months, 1 week ago

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

    moisb
    Participant
    # 2 months, 1 week ago

    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
    # 2 months, 1 week ago

    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.