Order products by category priority

  • mneimne
    Participant
    # 1 month, 3 weeks ago

    I have a site that displays a wide range or product categories (electronics, food, apparels, etc..)

    I have the following issue, when a user searches for the term “apple”, I want the products that are in “Electronics” category to appear first, then the ones under “food”.

    The thing is, when search for the term apple, users expect to see Apple related products and not the fruit.

    Thanks,

    wpsolr
    Keymaster
    # 1 month, 3 weeks ago

    You can boost your category values in WPSOLR’s screen 2.3

    But boost values do not depend on keywords: “Electronics” will be favoured for all keywords.

    mneimne
    Participant
    # 1 month, 3 weeks ago

    Thanks for the reply, I checked that page, but didn’t know how to configure it.
    Let’s say I selected the category in the boost options, how can I configure it to prioritize electronics category when the search term is “apple”

    wpsolr
    Keymaster
    # 1 month, 3 weeks ago

    You cannot. Boost values are not related to keywords, but to boosted content instead.

    For instance:
    Electronics^2
    Food^1

    mneimne
    Participant
    # 1 month, 3 weeks ago

    oh, I’ll give it a try then!
    Thanks

    mneimne
    Participant
    # 1 month, 3 weeks ago

    I applied the below on the product_cat field, but I am still getting grocery results before electronics:
    grocery^0.5
    electronics-mobiles^1
    I am not sure this is the correct field name, am I missing anything.

    Note: I reran the indexer.

    wpsolr
    Keymaster
    # 1 month, 3 weeks ago

    0.5 is lower than 1, which means grocery results are shown after electronics-mobiles

    wpsolr
    Keymaster
    # 1 month, 3 weeks ago

    You also need to use the label of the categories on the boost values, not the slug.

    mneimne
    Participant
    # 1 month, 3 weeks ago

    Thanks a lot, it is working, one last question :D.
    The boost is working on the last category, how can I make it work on the category hierarchy, example: Electronics & Mobiles > Mobile Phones > Apple, I want to boost Electronics & Mobiles.
    Best,

    wpsolr
    Keymaster
    # 1 month, 3 weeks ago

    You would have to apply the whole hierarchy to your products: product “Phone XXX” must have categories “Electronics & Mobiles”, “Mobile Phones”, and “Apple”.

    mneimne
    Participant
    # 1 month, 2 weeks ago

    Thanks!
    Everything is working as expected.

    mneimne
    Participant
    # 1 month, 1 week ago

    Hi again
    I am facing a weird scenario, when the search term is not found, I always get results from the boosted queries, Even if I put a complete test random characters.
    Anyway to fix this?
    Thanks,

    wpsolr
    Keymaster
    # 1 month, 1 week ago
    mneimne
    Participant
    # 1 month, 1 week ago

    Thanks, any idea when this will come out?
    Best

    wpsolr
    Keymaster
    # 1 month, 1 week ago

    It is out. You can download the fix on the roadmap link.

Viewing 15 posts - 1 through 15 (of 40 total)

You must be logged in to reply to this topic.