Boost Search on Taxonomy Pages

  • 1 year, 4 months ago #31238

    Found similar issue with this search:
    “query”: {
    “function_score”: {
    “functions”: [{
    “filter”: {
    “match”: {
    “product_visibility_str”: “featured”
    }
    },
    “weight”: 11
    }],
    “query”: {
    “bool”: {
    “must”: {
    “query_string”: {
    “fields”: [“title^11”, “product_visibility_str^11”, “summary_t”, “figures_str”, “tables_str”, “contents_str”, “synopsis_str”, “content^0.5”],
    “query”: “(Diabetic~1 Macular~1 Edema~1 drugs~1)”,
    “default_operator”: “AND”
    }
    },

    There is a product with the title., but once fuzzy is turned on, this query returns no results . Can you check if anything wrong in this query?

    1 year, 4 months ago #31239

    Even searching for the word Diabetic isn’t returning any results, after fuzzy turned on.

    wpsolr
    Keymaster
    1 year, 4 months ago #31240

    Here are my own tests, with a similar query:

    {
      "from": 0,
      "size": 1,
      "track_total_hits": true,
      "_source": [
        "title",
        "product_cat_str"
        ],
      "query": {
        "function_score": {
          "functions": [
            {
              "filter": {
                "match": {
                  "product_visibility_str": "featured"
                }
              },
              "weight": 11
            }
          ],
          "query": {
            "bool": {
              "must": {
                "query_string": {
                  "fields": [
                    "title^1",
                    "product_cat_str^1"
                  ],
                  "query": "(Kit~1 Blue~1)",
                  "default_operator": "AND"
                }
              }
            }
          }
        }
      }
    }
    {
      "took" : 3,
      "timed_out" : false,
      "_shards" : {
        "total" : 1,
        "successful" : 1,
        "skipped" : 0,
        "failed" : 0
      },
      "hits" : {
        "total" : {
          "value" : 76,
          "relation" : "eq"
        },
        "max_score" : 8.629168,
        "hits" : [
          {
            "_index" : "wpsolr-demo-woocommerce-100k-products",
            "_type" : "_doc",
            "_id" : "79452",
            "_score" : 8.629168,
            "_source" : {
              "product_cat_str" : [
                "Political Figures"
              ],
              "title" : "Kit Blue Blue"
            }
          }
        ]
      }
    }
    1 year, 4 months ago #31241

    Can you tell me, why this queries are different with fuzzy search activated. why there is ~ icon in our query, may be this is breaking the results ?
    “query”: “(Kit^1 Blue^1)”,
    “query”: (Diabetic~1 Macular~1 Edema~1 drugs~1)”,

    wpsolr
    Keymaster
    1 year, 4 months ago #31242

    “Diabetic~1” means that the search is on “Diabetic” with at most one letter different.

    Will match on:
    Diabetic
    Diabetik
    diabetic

    Will not match on (2 letters differences):
    Diabatik
    diabetik

    1 year, 4 months ago #31243

    why there is ~ icon in our query, also we have boost for all fields, but still that boost isnt showing in the query .

    “fields”: [“title^11”, “product_visibility_str^11”, “summary_t”, “figures_str”, “tables_str”, “contents_str”, “synopsis_str”, “content^0.5”],

    wpsolr
    Keymaster
    1 year, 4 months ago #31244

    why there is ~ icon in our query

    “~” comes from the fuzzy option.

    we have boost for all fields, but still that boost isnt showing in the query

    “summary_t” is equivalent to “summary_t^1”

    1 year, 4 months ago #31245

    Can you try with fuzzy search for same query?
    “query”: “(Kit~1 Blue~1)”,

    wpsolr
    Keymaster
    1 year, 4 months ago #31247

    Yes, I edited my previous query and executed it, with same results.

    1 year, 4 months ago #31248

    how can I fix issue with fuzzy search then ? as its not even able to match the first 3 words that are present in beginning of the title , which works fine with fuzzy turned off.

    1 year, 4 months ago #31260

    Here is the query with fuzzy :
    Image fuzzy-count.png of
    Here is the query without fuzzy :
    Image non-fuzzy-count.png of
    Any idea, where its going wrong?

    1 year, 4 months ago #31263

    Is there anything to do with this option ?
    Image image.png of

    wpsolr
    Keymaster
    1 year, 4 months ago #31264

    Fuzzy can have strange behaviours.
    Here is the Elasticsearch fuzziness documentation if you’re interested.

    wpsolr
    Keymaster
    1 year, 4 months ago #31265

    I recommend to configure suggestions on your search boxes. It will help your visitors find out the exact moment where some unfixable typos are made, and fix them early before the sentence is too long.

    1 year, 4 months ago #31266

    We found issue, after adding the boost , the query is retuning empty data. Here are the query monitor logs:
    With Boost
    Image with-boost.png of
    Without Boost
    Image without-boost.png of
    We definitely need to use boost, to give more priority to title if more keywords are matching.

Viewing 15 posts - 16 through 30 (of 49 total)

You must be logged in to reply to this topic.