WPSolr logo
Search
Close this search box.

Forum Replies Created

  • HaikoG
    Participant

    This is built-in functionality that doesn’t work.. We are not calling any filters?

    HaikoG
    Participant

    Wait.. we purchased this plugin.. now when it doesn’t work it’s up to us to dig around in the code and fix things?

    HaikoG
    Participant

    Yes, sure. This shows the same result. I you can share your email address I can send you the log if you want.

    HaikoG
    Participant

    I simply added an error_log(print_r($wpsolr_query,1)); to the start of execute_wpsolr_query() in /wpsolr-pro/wpsolr/core/classes/engines/class-wpsolr-abstractsearchclient.php

    That shows the filter is being added to the query object:
    [wpsolr_filter_query:protected] => Array
    (
    [0] => pa_kleur-van-het-product_str:Wit
    )

    I’ve enabled request logging in Solr to see the request that is received by Solr and that does not have this filter. It does filter on the selected product_cat_str, post_type, post_status_s

    We have collected all customizations in one single file which we have disabled during these tests, so I’m sure nothing interferes with the plugin defaults. We also do not run any caching on our development server.

    HaikoG
    Participant

    I also already tried to disable all the custom code and filtering, but that did not make a difference.

    HaikoG
    Participant

    Yes that is correct. All filters are broken. I can see them in the query object, but they are never added to the actual request to Solr

    HaikoG
    Participant

    We add multiple query filters to the query using set_filter_query_fields().
    For example we filter in_stock items only by ‘_stock_i:[1 TO *]’ or search in a few product categories only, but those queries are not included in the request. The same goes for when filtering using the facets. In this request I’m using the facet filtering, a log on the get_filter_query_fields() returns

    Array
    (
        [0] => pa_kleur-van-het-product_str:Wit
    )

    But when you check out the request that is received by Solr, there is not mentioning of the FQ.
    We did not do any customizations on the facet filters, so we expected this to keep working..

    {facet.field={!key%3Dproduct_cat_str+ex%3Dfct_excl_product_cat_str}product_cat_str&facet.field={!key%3Dpa_merk_str+ex%3Dfct_excl_pa_merk_str}pa_merk_str&facet.field={!key%3Dcategories_str+ex%3Dfct_excl_categories_str}categories_str&facet.field={!key%3Dpa_beeldschermdiagonaal_str+ex%3Dfct_excl_pa_beeldschermdiagonaal_str}pa_beeldschermdiagonaal_str&facet.field={!key%3Dpa_inclusief-besturingssysteem_str+ex%3Dfct_excl_pa_inclusief-besturingssysteem_str}pa_inclusief-besturingssysteem_str&facet.field={!key%3Dpa_ingebouwde-luidsprekers_str+ex%3Dfct_excl_pa_ingebouwde-luidsprekers_str}pa_ingebouwde-luidsprekers_str&facet.field={!key%3Dpa_intern-geheugen_str+ex%3Dfct_excl_pa_intern-geheugen_str}pa_intern-geheugen_str&facet.field={!key%3Dpa_kleur-van-het-product_str+ex%3Dfct_excl_pa_kleur-van-het-product_str}pa_kleur-van-het-product_str&facet.field={!key%3Dpa_processorfamilie_str+ex%3Dfct_excl_pa_processorfamilie_str}pa_processorfamilie_str&facet.field={!key%3Dpa_processormodel_str+ex%3Dfct_excl_pa_processormodel_str}pa_processormodel_str&facet.field={!key%3Dpa_resolutie_str+ex%3Dfct_excl_pa_resolutie_str}pa_resolutie_str&facet.field={!key%3Dpa_totale-opslagcapaciteit_str+ex%3Dfct_excl_pa_totale-opslagcapaciteit_str}pa_totale-opslagcapaciteit_str&facet.field={!key%3Dpa_touchscreen_str+ex%3Dfct_excl_pa_touchscreen_str}pa_touchscreen_str&facet.field={!key%3Dpa_ssd-interface_str+ex%3Dfct_excl_pa_ssd-interface_str}pa_ssd-interface_str&facet.field={!key%3Dpa_aansluiting_str+ex%3Dfct_excl_pa_aansluiting_str}pa_aansluiting_str&json.nl=flat&fl=id,PID,type,meta_type_s,title,numcomments,comments,displaydate,displaymodified,*categories_str,author,*post_thumbnail_href_str,*post_href_str,snippet_s,_stock_str,_stock_i,shop_thumbnail_url,_thumbnail_id_i,_visibility_str,permalink,post_status_s,sku,ERP_productnr_s,pricelist_ids,product_type_str,content,score,_price_f&start=0&q.op=AND&f.pa_inclusief-besturingssysteem_str.facet.sort=index&sort=_stock_i+desc&fq={!tag%3Dfct_excl_type}type:(“product”)&fq=-post_status_s:(“draft”+OR+”pending”+OR+”trash”+OR+”future”+OR+”private”+OR+”auto-draft”)&fq=(((*:*+-product_visibility_str:*))+OR+(-product_visibility_str:(exclude-from-catalog)))&fq=(*:*+-is_excluded_s:[*+TO+*])+OR+is_excluded_s:(n)&rows=48&q=(*)&defType=edismax&omitHeader=true&qf=pa_model_t^10+pa_merk_t^10+title^10+_sku_t^10+product_cat_str^3+content+ean_code_str+pa_ean-code_str+pa_frequentie-van-processor_str+pa_geheugencapaciteit_str+pa_harde-schijf-omvang_str+pa_opslagcapaciteit_str+pa_compatibele-producten_str^0.1+_product_attributes_str^0.2+pa_beeldschermdiagonaal_str+pa_capaciteit_str+pa_intern-geheugen_str+pa_interne-opslagcapaciteit_str+pa_interne-ram_str+pa_maximale-beeldresolutie_str+pa_maximale-opslagcapaciteit_str+pa_maximale-resolutie_str+pa_maximum-resolutie_str+pa_opslag-schijfgrootte_str+pa_opslagcapaciteit-harde-schijf_str+pa_processorfamilie_str+pa_processormodel_str+pa_projector-native-resolution_str+pa_resolutie_str+pa_schermgrootte_str+pa_schermgrootte-display_str+pa_schermresolutie-tablet_str+pa_standaardcapaciteit_str+pa_totale-opslagcapaciteit_str+pa_type-processor_str&stats=true&facet.mincount=1&wt=json&facet=true&stats.field={!ex%3Dfct_excl__price_f}_price_f}

    HaikoG
    Participant

    No the query is correct, but the query is not the issue. It all worked well before the update but not anymore.

    HaikoG
    Participant

    Found it:

    class-wpsolr-searchsolariumclient.php
    replace line 298: $field_value_escaped = “\”$field_value\””;
    with:
    if (strpos($field_value, “(“, 0) === false){
    $field_value_escaped = “\”$field_value\””;
    }else{
    $field_value_escaped = $field_value;
    }

    class-wpsolr-abstractsearchclient.php
    replace line 1618: $filter_query_field_value_escaped = “\”$filter_query_field_value\””;
    with:
    // In case the facet contains white space, we enclose it with “”.
    if (strpos($filter_query_field_value, “(“, 0) === false){
    $filter_query_field_value_escaped = “\”$filter_query_field_value\””;
    }else{
    $filter_query_field_value_escaped = $filter_query_field_value;
    }

    HaikoG
    Participant

    Any ideas how to get rid of these quotes?

    HaikoG
    Participant

    They are urlencoded.
    The first one is
    fq=%7B%21tag%3D%7Dpricelist_ids%3A%22156%22
    or decoded: fq={!tag=}pricelist_ids:”156″

    fq=%7B%21tag%3D%7Dpricelist_ids%3A%22%28%5C%221%5C%22+OR+%5C%22156%5C%22%29%22
    or decoded: fq={!tag=}pricelist_ids:”(\”1\”+OR+\”156\”)”

    I think the extra quotes around the brackets in the second one should not be there.

    HaikoG
    Participant

    I had to enable to logging, which was a bit of a hassle but requests are logged now. Unfortunately POST requests are not logged, so I had to revert to GET requests but the search results were the same. Here goes:

    Single pricelist_ids:

    [27/Feb/2020:08:11:12 +0000] “GET /solr/xxx/select?omitHeader=true&wt=json&json.nl=flat&q=%28probook%29&start=0&rows=12&fl=id%2CPID%2Ctype%2Cmeta_type_s%2Ctitle%2Cnumcomments%2Ccomments%2Cdisplaydate%2Cdisplaymodified%2C%2Acategories_str%2Cauthor%2C%2Apost_thumbnail_href_str%2C%2Apost_href_str%2Csnippet_s%2C_stock_str%2Cshop_thumbnail_url%2C_thumbnail_id_i%2C_visibility_str%2Cpermalink&q.op=AND&sort=_stock_i+desc&fq=type%3A%28%22product%22%29&fq=-post_status_s%3A%28%22draft%22+OR+%22pending%22+OR+%22trash%22+OR+%22future%22+OR+%22private%22+OR+%22auto-draft%22%29&fq=%7B%21tag%3D%7Dpricelist_ids%3A%22156%22&fq=%7B%21tag%3D%7Dtype%3A%22product%22&fq=%7B%21tag%3D%7Dtype%3A%22product%22&fq=%28%28%2A%3A%2A+-product_visibility_str%3A%2A%29+OR+-product_visibility_str%3A%28exclude-from-search%29%29&fq=%28%2A%3A%2A+-is_excluded_s%3A%5B%2A+TO+%2A%5D%29+OR+is_excluded_s%3A%28n%29&fq=%7B%21tag%3D%7Dtype%3A%22product%22&defType=edismax&qf=product_cat_t%5E5+title%5E5+content%5E2+ean_code_str+_sku_s+pa_ean-code_str+pa_frequentie-van-processor_str+pa_geheugencapaciteit_str+pa_harde-schijf-omvang_str+pa_opslagcapaciteit_str+pa_compatibele-producten_str%5E0.1+_product_attributes_str%5E0.2+pa_beeldschermdiagonaal_str+pa_capaciteit_str+pa_intern-geheugen_str+pa_interne-opslagcapaciteit_str+pa_interne-ram_str+pa_maximale-beeldresolutie_str+pa_maximale-opslagcapaciteit_str+pa_maximale-resolutie_str+pa_maximum-resolutie_str+pa_opslag-schijfgrootte_str+pa_opslagcapaciteit-harde-schijf_str+pa_processorfamilie_str+pa_processormodel_str+pa_projector-native-resolution_str+pa_resolutie_str+pa_schermgrootte_str+pa_schermgrootte-display_str+pa_schermresolutie-tablet_str+pa_standaardcapaciteit_str+pa_totale-opslagcapaciteit_str+pa_type-processor_str&facet=true&facet.mincount=1&facet.limit=12&facet.field=%7B%21key%3Dproduct_cat_str+ex%3Dfct_ex_product_cat_str%7Dproduct_cat_str&facet.field=%7B%21key%3Dpa_merk_str+ex%3Dfct_ex_pa_merk_str%7Dpa_merk_str&facet.field=%7B%21key%3Dcategories_str+ex%3Dfct_ex_categories%7Dcategories_str&facet.field=%7B%21key%3Dpa_beeldschermdiagonaal_str+ex%3Dfct_ex_pa_beeldschermdiagonaal_str%7Dpa_beeldschermdiagonaal_str&facet.field=%7B%21key%3Dpa_inclusief-besturingssysteem_str+ex%3Dfct_ex_pa_inclusief-besturingssysteem_str%7Dpa_inclusief-besturingssysteem_str&facet.field=%7B%21key%3Dpa_ingebouwde-luidsprekers_str+ex%3Dfct_ex_pa_ingebouwde-luidsprekers_str%7Dpa_ingebouwde-luidsprekers_str&facet.field=%7B%21key%3Dpa_intern-geheugen_str+ex%3Dfct_ex_pa_intern-geheugen_str%7Dpa_intern-geheugen_str&facet.field=%7B%21key%3Dpa_kleur-van-het-product_str+ex%3Dfct_ex_pa_kleur-van-het-product_str%7Dpa_kleur-van-het-product_str&facet.field=%7B%21key%3Dpa_processorfamilie_str+ex%3Dfct_ex_pa_processorfamilie_str%7Dpa_processorfamilie_str&facet.field=%7B%21key%3Dpa_processormodel_str+ex%3Dfct_ex_pa_processormodel_str%7Dpa_processormodel_str&facet.field=%7B%21key%3Dpa_resolutie_str+ex%3Dfct_ex_pa_resolutie_str%7Dpa_resolutie_str&facet.field=%7B%21key%3Dpa_totale-opslagcapaciteit_str+ex%3Dfct_ex_pa_totale-opslagcapaciteit_str%7Dpa_totale-opslagcapaciteit_str&facet.field=%7B%21key%3Dpa_touchscreen_str+ex%3Dfct_ex_pa_touchscreen_str%7Dpa_touchscreen_str&facet.field=%7B%21key%3Dpa_ssd-interface_str+ex%3Dfct_ex_pa_ssd-interface_str%7Dpa_ssd-interface_str&f.pa_inclusief-besturingssysteem_str.facet.sort=index&stats=true&stats.field=%7B%21ex%3Dfct_ex__price_str%7D_price_f&hl=true&hl.fl=title%2Ccontent%2Ccomments&f.title.hl.fragsize=100&f.title.hl.simple.pre=%3Cb%3E&f.title.hl.simple.post=%3C%2Fb%3E&f.content.hl.fragsize=100&f.content.hl.simple.pre=%3Cb%3E&f.content.hl.simple.post=%3C%2Fb%3E&f.comments.hl.fragsize=100&f.comments.hl.simple.pre=%3Cb%3E&f.comments.hl.simple.post=%3C%2Fb%3E HTTP/1.1” 200 6082

    multiple pricelists_ids with OR statement:

    [27/Feb/2020:08:13:38 +0000] “GET /solr/xxx/select?omitHeader=true&wt=json&json.nl=flat&q=%28probook%29&start=0&rows=12&fl=id%2CPID%2Ctype%2Cmeta_type_s%2Ctitle%2Cnumcomments%2Ccomments%2Cdisplaydate%2Cdisplaymodified%2C%2Acategories_str%2Cauthor%2C%2Apost_thumbnail_href_str%2C%2Apost_href_str%2Csnippet_s%2C_stock_str%2Cshop_thumbnail_url%2C_thumbnail_id_i%2C_visibility_str%2Cpermalink&q.op=AND&sort=_stock_i+desc&fq=type%3A%28%22product%22%29&fq=-post_status_s%3A%28%22draft%22+OR+%22pending%22+OR+%22trash%22+OR+%22future%22+OR+%22private%22+OR+%22auto-draft%22%29&fq=%7B%21tag%3D%7Dpricelist_ids%3A%22%28%5C%221%5C%22+OR+%5C%22156%5C%22%29%22&fq=%7B%21tag%3D%7Dtype%3A%22product%22&fq=%7B%21tag%3D%7Dtype%3A%22product%22&fq=%28%28%2A%3A%2A+-product_visibility_str%3A%2A%29+OR+-product_visibility_str%3A%28exclude-from-search%29%29&fq=%28%2A%3A%2A+-is_excluded_s%3A%5B%2A+TO+%2A%5D%29+OR+is_excluded_s%3A%28n%29&fq=%7B%21tag%3D%7Dtype%3A%22product%22&defType=edismax&qf=product_cat_t%5E5+title%5E5+content%5E2+ean_code_str+_sku_s+pa_ean-code_str+pa_frequentie-van-processor_str+pa_geheugencapaciteit_str+pa_harde-schijf-omvang_str+pa_opslagcapaciteit_str+pa_compatibele-producten_str%5E0.1+_product_attributes_str%5E0.2+pa_beeldschermdiagonaal_str+pa_capaciteit_str+pa_intern-geheugen_str+pa_interne-opslagcapaciteit_str+pa_interne-ram_str+pa_maximale-beeldresolutie_str+pa_maximale-opslagcapaciteit_str+pa_maximale-resolutie_str+pa_maximum-resolutie_str+pa_opslag-schijfgrootte_str+pa_opslagcapaciteit-harde-schijf_str+pa_processorfamilie_str+pa_processormodel_str+pa_projector-native-resolution_str+pa_resolutie_str+pa_schermgrootte_str+pa_schermgrootte-display_str+pa_schermresolutie-tablet_str+pa_standaardcapaciteit_str+pa_totale-opslagcapaciteit_str+pa_type-processor_str&facet=true&facet.mincount=1&facet.limit=12&facet.field=%7B%21key%3Dproduct_cat_str+ex%3Dfct_ex_product_cat_str%7Dproduct_cat_str&facet.field=%7B%21key%3Dpa_merk_str+ex%3Dfct_ex_pa_merk_str%7Dpa_merk_str&facet.field=%7B%21key%3Dcategories_str+ex%3Dfct_ex_categories%7Dcategories_str&facet.field=%7B%21key%3Dpa_beeldschermdiagonaal_str+ex%3Dfct_ex_pa_beeldschermdiagonaal_str%7Dpa_beeldschermdiagonaal_str&facet.field=%7B%21key%3Dpa_inclusief-besturingssysteem_str+ex%3Dfct_ex_pa_inclusief-besturingssysteem_str%7Dpa_inclusief-besturingssysteem_str&facet.field=%7B%21key%3Dpa_ingebouwde-luidsprekers_str+ex%3Dfct_ex_pa_ingebouwde-luidsprekers_str%7Dpa_ingebouwde-luidsprekers_str&facet.field=%7B%21key%3Dpa_intern-geheugen_str+ex%3Dfct_ex_pa_intern-geheugen_str%7Dpa_intern-geheugen_str&facet.field=%7B%21key%3Dpa_kleur-van-het-product_str+ex%3Dfct_ex_pa_kleur-van-het-product_str%7Dpa_kleur-van-het-product_str&facet.field=%7B%21key%3Dpa_processorfamilie_str+ex%3Dfct_ex_pa_processorfamilie_str%7Dpa_processorfamilie_str&facet.field=%7B%21key%3Dpa_processormodel_str+ex%3Dfct_ex_pa_processormodel_str%7Dpa_processormodel_str&facet.field=%7B%21key%3Dpa_resolutie_str+ex%3Dfct_ex_pa_resolutie_str%7Dpa_resolutie_str&facet.field=%7B%21key%3Dpa_totale-opslagcapaciteit_str+ex%3Dfct_ex_pa_totale-opslagcapaciteit_str%7Dpa_totale-opslagcapaciteit_str&facet.field=%7B%21key%3Dpa_touchscreen_str+ex%3Dfct_ex_pa_touchscreen_str%7Dpa_touchscreen_str&facet.field=%7B%21key%3Dpa_ssd-interface_str+ex%3Dfct_ex_pa_ssd-interface_str%7Dpa_ssd-interface_str&f.pa_inclusief-besturingssysteem_str.facet.sort=index&stats=true&stats.field=%7B%21ex%3Dfct_ex__price_str%7D_price_f&hl=true&hl.fl=title%2Ccontent%2Ccomments&f.title.hl.fragsize=100&f.title.hl.simple.pre=%3Cb%3E&f.title.hl.simple.post=%3C%2Fb%3E&f.content.hl.fragsize=100&f.content.hl.simple.pre=%3Cb%3E&f.content.hl.simple.post=%3C%2Fb%3E&f.comments.hl.fragsize=100&f.comments.hl.simple.pre=%3Cb%3E&f.comments.hl.simple.post=%3C%2Fb%3E&spellcheck=true&spellcheck.q=probook&spellcheck.count=10&spellcheck.extendedResults=true&spellcheck.collate=true&spellcheck.collateExtendedResults=true HTTP/1.1” 200 1023

    HaikoG
    Participant
    4 years, 4 months ago in reply to: Change request method to POST for queries #16816

    Awesome! that works like a charm!

    Thanks

    HaikoG
    Participant
    4 years, 4 months ago in reply to: Change request method to POST for queries #16814

    Thanks for the quick reply
    I think the postbigrequest-plugin is what we’re after, but I haven’t figured out how to activate it yet.

    getPlugin(‘postbigrequest’);
    According to the documentation that should be called on the solarium client, but the obj from get_solr_client does not recognize the function

    $solr_client = WPSOLR_Service_Container::get_solr_client( false );

    any ideas?

    HaikoG
    Participant

    Oh, that in class-wpsolr-plugin-yith-woocommerce-ajax-search-free.php

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