10up / ElasticPress

A fast and flexible search and query engine for WordPress.
https://elasticpress.io
GNU General Public License v2.0
1.25k stars 312 forks source link

BUG: Cannot index/sync product drafts and shop_order #3316

Closed creative-andrew closed 1 year ago

creative-andrew commented 1 year ago

Describe the bug

Hello,

Since I updated ElasticPress from version https://github.com/10up/ElasticPress/releases/tag/4.1.0 to 4.4.1, I cannot index/sync draft products and shop_order.

I use the following filters to benefit from ElasticPress's fast queries also in the backend.

add_filter('ep_indexable_post_types', function() {
   return ['product', 'product_variation', 'shop_order'];
});
add_filter('ep_admin_wp_query_integration', '__return_true');
add_filter('ep_ajax_wp_query_integration', '__return_true');

After updating to version 4.4.1, I cannot see draft products in the backend as well as the orders in the WooCommerce order page. This used to work fine before.

Has something changed I need to adapt?

Steps to Reproduce

  1. Enable ElasticPress to work also for the backend
  2. Create some draft products and test the sync process.
  3. Also allow it to sync shop_order as Indexables

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct

felipeelia commented 1 year ago

@creative-andrew we will need you to send the Status Report page content in order to help you. Can you please go to ElasticPress > Status Report, click "Copy status report to clipboard", and paste those details here or in a txt file? Thanks.

creative-andrew commented 1 year ago

@felipeelia Thanks for your message. Here is the requested info.

This is the command that works fine on 4.1.0 but fails in 4.4.1

wp elasticpress index --post-type=shop_order
Warning: This command is deprecated. Please use sync instead.
Success: Indexing posts…
Success: Number of posts indexed: 0
Success: Sync complete
Total time elapsed: 00:00:00.101000
Success: Done!

WordPress

WordPress Environment

wp_version: 6.1.1 is_multisite: false theme: WOPA (0.1.0) parent_theme: WOPA (0.1.0) plugins: ACF Add-ons (1.1.1), Advanced Coupons for WooCommerce Free (4.0.3), Advanced Coupons for WooCommerce Premium (3.1.4), Advanced Custom Fields: Address (5.1.0), Advanced Custom Fields PRO (5.12.2), Advanced Editor Tools (previously TinyMCE Advanced) (5.6.0), Aelia Currency Switcher for WooCommerce (4.13.3.220224), Aelia Foundation Classes for WooCommerce (2.2.5.220330), Aelia Tax Display by Country for WooCommerce (1.17.14.220224), Akismet Anti-Spam (5.0.2a2), BJ Lazy Load (1.0.9), Category Order and Taxonomy Terms Order (1.6), Classic Widgets (0.3), CO2 Compensation (1.0.0), CoCo | netzstrategen cookie consent and cookie notice plugin (2.1.1), Core Standards (3.1.0), CTX Feed Pro (5.3.25), Custom (1.3.0), Custom Order Numbers for WooCommerce (1.3.4), Delayed Delivery Alert (1.0.2), Disable Emojis (GDPR friendly) (1.7.4), ElasticPress (4.4.1), Energy Label (2.0.3), Gallerya (2.9.1), German Market (3.14), Gravity Forms (2.6.1.1), Gravity Forms + Custom Post Types (3.1.26), Gravity Forms Mailchimp Add-On (5.1), Gravity Forms Survey Add-On (3.7), Gravity Forms User Registration Add-On (5.0), Image Disclaimer (1.3.2), Language Fallback (1.0.5), Lowest Delivery Time Variations (1.0.1), Open Closed (1.0.5), Optimus (1.6.1), Page Links To (3.3.6), Popup Maker (1.16.7), PublishPress Future (2.7.3), Real Media Library (Free) (4.18.9), Sale Percentage (1.0.4), Schema & Structured Data for WP & AMP (1.9.95), Shop Analytics (1.11.7), Shop Standards (1.45.0), Shop Standards Notices (0.2.1), User Role Editor Pro (4.62.1), WooChimp (2.2.7), WooCommerce (6.4.0), WooCommerce Advanced Bulk Edit (5.0.2.1), WooCommerce Advanced Product Labels (1.2.1), WooCommerce Amazon Pay (2.1.3), WooCommerce Attribute Swatches by Iconic (1.8.0), WooCommerce Conditional Shipping and Payments (1.12.1), Woocommerce Custom Tabs PRO (1.0.30), WooCommerce Dynamic Pricing (3.1.27), Woocommerce Dynamic Shipping Info (2.0.0), WooCommerce Email Customizer Plus (1.2.9), WooCommerce EU VAT Number (2.4.2), WooCommerce Extended Coupon Features PRO (3.2.9), WooCommerce Local Store (1.1.0), WooCommerce Min/Max Quantities (2.4.24), WooCommerce MOEVE (2.7.3), WooCommerce Order Status Manager (1.13.3), WooCommerce PayPal Payments (2.0.1), WooCommerce Price Labels (1.2.5), WooCommerce Related Accessories (1.1.8), WooCommerce Reputations (1.7.7), WooCommerce Stripe Gateway (6.3.0), WooCommerce Table Rate Shipping (3.0.37), WP-Lister Pro for Amazon (2.4.1), WP All Export - WooCommerce Export Add-On Pro (1.0.5), WP All Export Pro (1.7.8), WP All Import - ACF Add-On (3.3.6), WP All Import - WooCommerce Import Add-On Pro (3.3.0), WP All Import Pro (4.7.2), WPC Custom Related Products for WooCommerce (1.3.2), WP Mail SMTP (3.3.0), WP Snippets (150201), YITH WooCommerce Questions and Answers Premium (1.12.0), YITH WooCommerce Quick View (1.14.0), Yoast SEO (18.6) und Yoast SEO Premium (18.4) revisions: all

Server Environment

php_version: 8.0.27 memory_limit: 2048M timeout: 1800

Indexable Content

product_count: 2.537 product_variation_count: 12.413 shop_order_count: 0 product_meta_keys: 140 product_variation_meta_keys: 152 shop_order_meta_keys: 62 total-all-post-types: 310 distinct-meta-keys: total_sales, _downloadable, _virtual, _regular_price, _sale_price, _tax_status, _tax_class, _visibility, _purchase_note, _featured, _weight, _length, _width, _height, _sku, _product_attributes, _sale_price_dates_from, _sale_price_dates_to, _price, _sold_individually, _manage_stock, _backorders, _stock_status, _stock, _wc_average_rating, _thumbnail_id, _product_image_gallery, _product_version, _sale_percentage, _bj_lazy_load_skip_post, minimum_allowed_quantity, maximum_allowed_quantity, group_of_quantity, minmax_do_not_count, minmax_cart_exclude, minmax_category_group_of_exclude, _lieferzeit, product_function_desc_textarea, _upsell_ids, _crosssell_ids, _default_attributes, _woocommerce-moeve_id_1, lieferart_tab_custom_title, lieferart, common_tab_tab_custom_title, common_tab, saswp_custom_schema_field, itemlist_item_77282, music_composer_77282, movie_actor_77282, article_items_77282, image_object_exif_data_77282, blogposting_items_77282, newsarticle_items_77282, tech_article_items_77282, product_reviews_77282, feed_element_77282, faq_question_77282, performer_77282, accepted_answer_77282, suggested_answer_77282, howto_supply_77282, howto_tool_77282, howto_step_77282, music_playlist_track_77282, music_album_track_77282, apartment_amenities_77282, additional_property_77282, mc_cause_77282, mc_symptom_77282, mc_risk_factor_77282, tvseries_actor_77282, tvseries_season_77282, trip_itinerary_77282, local_enable_rating_77282, itemlist_item_72312, music_composer_72312, movie_actor_72312, article_items_72312, image_object_exif_data_72312, blogposting_items_72312, newsarticle_items_72312, tech_article_items_72312, product_reviews_72312, feed_element_72312, faq_question_72312, performer_72312, accepted_answer_72312, suggested_answer_72312, howto_supply_72312, howto_tool_72312, howto_step_72312, music_playlist_track_72312, music_album_track_72312, apartment_amenities_72312, additional_property_72312, mc_cause_72312, mc_symptom_72312, mc_risk_factor_72312, tvseries_actor_72312, tvseries_season_72312, trip_itinerary_72312, field_group_related_accessories_zubehoer, field_group_related_accessories_pflegemittel, field_group_related_accessories_accessoires-und-deko, field_group_related_accessories, field_group_related_accessories_accessoires_und_deko, _woocommerce-moeve_id_2, _woocommerce-moeve_id_3, _woocommerce-moeve_setid, allow_combination, _shop-standards_back_in_stock_date, _woocommerce-moeve_id_4, _woocommerce-moeve_id_5, variable_sale_currency_prices, pa_marken, _woocommerce-moeve_id_6, _woocommerce-moeve_id_7, _woocommerce-moeve_id_8, _woocommerce-moeve_id_9, ep_exclude_from_search, downloads_tab_custom_title, downloads, _min_variation_price, _max_variation_price, _min_variation_regular_price, _max_variation_regular_price, _min_variation_sale_price, _max_variation_sale_price, _min_price_variation_id, _max_price_variation_id, _min_regular_price_variation_id, _max_regular_price_variation_id, _min_sale_price_variation_id, _max_sale_price_variation_id, subtitle, shop_analytics_custom_product_name, _woocommerce-moeve_id_10, woo_feed_gtin, woo_feed_ean, attribute_pa_ausfuehrung-sitzflaeche, min_max_rules, variation_minimum_allowed_quantity, variation_maximum_allowed_quantity, variation_group_of_quantity, variation_minmax_do_not_count, variation_minmax_cart_exclude, variation_minmax_category_group_of_exclude, attribute_pa_hersteller, attribute_pa_erhaeltlich-bei, attribute_pa_erhaeltlich-in, variable_regular_currency_prices, woo_feed_gtin_var, woo_feed_mpn_var, woo_feed_ean_var, attribute_pa_ausfuehrung-korpus, attribute_pa_modelltyp, attribute_pa_ausfuehrung, attribute_pa_hoehe-in-cm, attribute_pa_breite-in-cm, attribute_pa_material-korpus, attribute_pa_ausfuehrung-bezug, attribute_pa_stil, attribute_pa_masse-b-h-t-in-cm, attribute_pa_kategorie, attribute_pa_ausfuehrung-tueren, attribute_pa_produktart-teppich, attribute_pa_zusatzausstattung, attribute_pa_masse-h-d-in-cm, attribute_pa_raum, attribute_pa_ausfuehrung-gestell, attribute_pa_ausfuehrung-tischplatte, attribute_pa_ausfuehrung-auszug, attribute_pa_anordnung, attribute_pa_ausfuehrung-fuesse, attribute_pa_durchmesser-in-cm, attribute_pa_guetesiegel, attribute_pa_funktion, attribute_pa_variante-funktion, attribute_pa_warensortiment, attribute_pa_ausfuehrung-ablage, attribute_pa_ausfuehrung-armlehne, attribute_pa_breite-tischplatte, attribute_pa_schale-sitzkissen-gestell, attribute_pa_zubehoer, attribute_pa_variante-hoehe, attribute_pa_ottomane, attribute_pa_ausfuehrung-funktion, attribute_pa_ausfuehrung-sofa, attribute_pa_topper, attribute_pa_bezug-topper, attribute_ausfuehrung-tuer, attribute_pa_tiefe-in-cm, attribute_pa_farbe, attribute_pa_masse-b-t-in-cm, attribute_pa_masse-b-h-in-cm, attribute_pa_masse-b-x-l-haertegrad, attribute_pa_masse-b-l-in-cm, attribute_pa_haertegrad, attribute_pa_ausfuehrung-rahmen, attribute_sitzqualitaet, attribute_pa_innenausstattung, attribute_pa_ausfuehrung-bez-sofa-kissen, attribute_pa_ausfuehrung-korpus-front, attribute_pa_polsterung, attribute_pa_ausf-bez-ausf-kopfteil, attribute_pa_tueren-und-schubkaesten, attribute_pa_ausfuehrung-kissenbezug, attribute_pa_fuellmaterial, attribute_pa_funktion-gestell, attribute_pa_ausfuehrung-teppich, attribute_pa_ausfuehrung-griffe, attribute_pa_masse-b-h-l-in-cm, attribute_pa_design-masse, attribute_zusatzausstattung-2, attribute_pa_masse-b-x-t-ausfuehrung, attribute_pa_ausf-bez-inn-ausf-bez-auss, attribute_pa_ausfuehrung-decke-masse, attribute_pa_sitzhoehe-in-cm, attribute_option-liegeruecken, attribute_pa_produktart-sofa, attribute_ausfuehrung-korpus-deckplatte, attribute_ausfuehrung-korpus-ablage, attribute_ausfuehrung-tischgestell-tischplatte, attribute_ausfuehrung-bankgestell-sitzflaeche, attribute_pa_haertegrad-matratzen, attribute_tuerdaempfer, attribute_passepartout, attribute_pa_ausfuehrung-front, attribute_ausfuehrung, attribute_ausfuehrung-beleuchtung, attribute_pa_breite-ausfuehrung, attribute_pa_liegeflaeche-b-x-l-in-cm, attribute_pa_produktart-kommode, attribute_bettkasten, attribute_groesse-sessel, attribute_pa_material-gestell, attribute_pa_ottomane-funktion, attribute_groesse, attribute_pa_matratzenhoehe-in-cm, attribute_pa_ausfuehrung-kopfteil, attribute_pa_ausf-bez-korp-ausf-bez-sitz, attribute_pa_groesse-sessel, attribute_pa_material-ruecken-echt, attribute_ausstattung, attribute_anzahl-stuehle, attribute_pa_ausfuehrung-naht, attribute_pa_stellmass-in-cm, attribute_pa_sitztiefe-in-cm, attribute_lattenrost-matratze, _order_key, _customer_user, _billing_first_name, _billing_last_name, _billing_company, _billing_address_1, _billing_address_2, _billing_city, _billing_state, _billing_postcode, _billing_country, _billing_email, _billing_phone, _shipping_first_name, _shipping_last_name, _shipping_address_1, _shipping_address_2, _shipping_city, _shipping_state, _shipping_postcode, _shipping_country, Payer PayPal address, Payer first name, Payer last name, Payment type, PayPal Transaction Fee, woocommerce-moeve-exported-at, amazon_reference_id, amazon_authorization_id, amazon_capture_id, amazon_capture_state, woochimp_subscribe_on_placed, amazon_refund_id, amazon_refunds, is_vat_exempt, amazon_order_language, amazon_payment_advanced_version, woocommerce_version, reference_number, instruction_type, payment_due_date, bank_name, account_holder_name, international_bank_account_number, bank_identifier_code, amazon_timed_out_transaction, amazon_timed_out_times, amazon_reference_state, _alg_wc_custom_order_number, amazon_authorization_state, woocommerce-moeve-order-number, woocommerce-moeve-customer-id, woocommerce-moeve-not-found, amazon_charge_permission_id, amazon_charge_permission_status, amazon_charge_id, amazon_charge_status, woocommerce-moeve-exported-steps, PayPal Transaction Key und ppcp_ratepay_payment_instructions_payment_reference

ElasticPress

Settings

index_prefix: language: de_DE per_page: 350 network_active: false

Timeouts

request_timeout: 5 index_document_timeout: 15 bulk_request_timeout: 30

Elasticsearch Indices

active-wopa-production-post-1

health: yellow status: open index: active-wopa-production-post-1 pri: 5 rep: 1 docs.count: 24470 docs.deleted: 9240 store.size: 315.2mb pri.store.size: 315.2mb total_fields_limit: 20000

active-wopa-production-term-1

health: yellow status: open index: active-wopa-production-term-1 pri: 1 rep: 1 docs.count: 742 docs.deleted: 0 store.size: 2.4mb pri.store.size: 2.4mb total_fields_limit: 5000

Last Sync

end_date_time: 2023/02/16 2:21:46 pm total_time: 0 Stunden, 12 Minuten, 42 Sekunden total: 7224 synced: 7224 skipped: 0 failed: 0 errors: array ( )

Feature Settings

Custom Search Results

active: true force_inactive: false

Facets

active: true force_inactive: false match_type: all

Post Search

active: true decaying_enabled: 0 force_inactive: false

Related Posts

active: true force_inactive: false

Terms

active: true force_inactive: false

WooCommerce

active: true force_inactive: false

felipeelia commented 1 year ago

@creative-andrew any reason why you don't simply enable the Protected Content feature? That should enable orders search automatically.

creative-andrew commented 1 year ago

@felipeelia Thanks that was it!