Jetpack: Search: Make WooCommerce Products searchable

Created on 30 Jan 2018  Â·  16Comments  Â·  Source: Automattic/jetpack

Starting this ticket to track what we need to index to make Woo search better.

There are a bunch of fields to add from different post meta fields:

  • reg price
  • sale price
  • review count

    • count

    • average rating

  • featured
  • product type
  • SKU
  • shipping info?
  • stock status
  • upsell ids (hardcoded list, could also auto gen a list from orders)
  • cross sell ids (hardcoded list, could also auto gen a list from orders)

Content should also be indexed:

  • all reviews should be attached to the post so that we can use the reviews as additional search criteria
  • purchase notes
  • could index reviews as comments so we can search reviews and do filtering on reviews
Instant Search Search [Status] Search Index Change [Type] Enhancement [Type] Happiness Request

Most helpful comment

@bizanimesh fyi this is (one of) the PR where it is actively being worked on: https://github.com/Automattic/jetpack/pull/18225

All 16 comments

Possibly related in 1047772-zen.
Dropping the reference ^^ here for future checkins with this user.

I am very keen to see this implemented, compatibility is needed with the different product types too (variable, grouped products etc...)

I've just had to implement jetpack search with woocommerce products, so a few notes from me:

  • Woocommerce fields are generally private meta fields, which don't get indexed, so some procedure to either index these or copy them to non private fields (which is what I ended up doing) would be necessary.

  • If indexing prices it makes sense to add support for price range aggregations in jetpack search. This isn't too tricky, but what you probably want to do is dynamically generate the price ranges based off the result. To do this, you'd need to do a preliminary query and then use the results to put the prices into the buckets for the price range request.

Woocommerce fields are generally private meta fields

@jenkoian ya, I'm working on doing this indexing, but this is definitely something that is giving me pause right now. I can index them, but then they won't really be private anymore. But technically they aren't really "private". They are "protected", and end up getting displayed on the front end anyways. Really I need to look more into how WooCommerce handles these in its public apis I think.

@jenkoian Ian, any chance you could share a little of that in a gist, for the inspiration of others. I'm seeing so little docco on ElasticSearch in Jetpack, so slow going!

@alicam yep! Which bit, the price range aggregations or..?

This issue has been marked as stale. This happened because:

  • It has been inactive in the past 6 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

Many of these fields should work (SKU and product categories at the least) in the new instant search experience, but we haven't done much testing and are needing to delay further work so we can ship.

This issue has been marked as stale. This happened because:

  • It has been inactive in the past 6 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

Hi team, Just want to confirm if it is possible to display product prices in Jetpack Search if the user has installed WooCommerce. 🙂

For 3728749-zd-woothemes

@bizanimesh No, it is not yet possible. This is currently being worked on, but the feature is not yet available. We will close this issue when it is available.

Hi team, Does JP Search index correctly for products that have custom permalinks? For example, using /puppies/ instead of /products/ in the product permalink.

For 3730322-zd-woothemes

@bizanimesh fyi this is (one of) the PR where it is actively being worked on: https://github.com/Automattic/jetpack/pull/18225

Seems like this shifted away from the base search module and to Instant Search. Issues with the base search module and Woo still remain.

I recently reviewed that the base Jetpack Search module (not Instant Search) seems to prevent the use of WooCommerce filters within Woo product searches. To get this working properly, the module has to be deactivated.

Example
Here's a search string for a product titled TestProduct that has a color attribute of blue. Woo lets us filter that attribute.

?s=TestProduct&post_type=product&filter_color=blue

This will only work if the Jetpack search module is disabled. If enabled, the product search will return No products were found matching your selection.

This will also prevent WooCommerce extensions such as https://woocommerce.com/products/product-filters/ from working properly when paired with a search.


I can open a separate report or report elsewhere if necessary.


An internal example was discussed on p9F6qB-6wy-p2

@JoshuaGoode ya the "base search" is really deprecated and won't ever be getting updated to support things like woocommerce filters. It is being actively worked on for instant search though.

I'm going to mark this as done. From an indexing perspective it is complete. There is still some ongoing cleanup of ensuring sync always works correctly (see #15672 and the related PR), but I don't think I've yet seen it fail. Displaying the results is being handled in some other issues and PRs but all seems to be working so keeping this open doesn't seem to help.

Was this page helpful?
0 / 5 - 0 ratings