Order products by category priority

  • mneimne
    Participant
    2 years ago #29412

    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
    2 years ago #29413

    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
    2 years ago #29414

    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
    2 years ago #29415

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

    For instance:
    Electronics^2
    Food^1

    mneimne
    Participant
    2 years ago #29416

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

    mneimne
    Participant
    2 years ago #29418

    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
    2 years ago #29419

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

    wpsolr
    Keymaster
    2 years ago #29420

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

    mneimne
    Participant
    2 years ago #29427

    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
    2 years ago #29428

    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 year, 12 months ago #29442

    Thanks!
    Everything is working as expected.

    mneimne
    Participant
    1 year, 11 months ago #29466

    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
    mneimne
    Participant
    1 year, 11 months ago #29468

    Thanks, any idea when this will come out?
    Best

    wpsolr
    Keymaster
    1 year, 11 months ago #29469

    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.