Boost Search on Taxonomy Pages

  • 1 year, 7 months ago #31068

    Hi,
    I have added boost to search results based on Featured taxonomy, its working fine but its also effecting search results on the main search page. How can I limit it to only taxonomy pages only ? Can you help me with an action to not alter any results if not taxonomy page.

    wpsolr
    Keymaster
    1 year, 7 months ago #31073

    I checked, but I could not find a way to activate/deactivate boosts based on some context like being on a taxonomy archive.

    1 year, 6 months ago #31189

    Hello, when we turn on boost, the search is not searching inside custom product fields content, which is working without boost enabled. Can you tell me what’s wrong with this setting:
    Image image.png of
    We indexed all the custom fields, whenever we search a keyword from custom field, its is working without boost functionality enabled. Fuzzy search and partial match is also turned off.

    wpsolr
    Keymaster
    1 year, 6 months ago #31190

    Boosting is on or off. If it is on, you need to setup boost for all your custom fields that are searchable.

    1 year, 6 months ago #31196

    I added boost for all custom fields , still not working. the results when trying to search within the content of custom field is empty with boost turned on.

    wpsolr
    Keymaster
    1 year, 6 months ago #31197

    Can you try with the exact custom field value (uppercase/lowercase)?

    If it works, then use the option “Copy to a text field” on each boosted field.
    (reindex all your data afterwards)

    1 year, 6 months ago #31202

    we are trying with exact text copied from custom field, also tried with all lowercase, we are using the field type as long text (_t) , as without this indexing was breaking if we use _str.

    wpsolr
    Keymaster
    1 year, 6 months ago #31203

    Please activate the Query Monitor extension, and let me see what the WPSOLR query looks like.

    1 year, 6 months ago #31204

    Here is the query :
    {
    “from”: 0,
    “size”: 20,
    “track_total_hits”: true,
    “sort”: [
    {
    “publication_date_dt”: {
    “order”: “desc”
    }
    }
    ],
    “_source”: [
    “id”,
    “PID”,
    “type”,
    “meta_type_s”,
    “title”,
    “numcomments”,
    “comments”,
    “displaydate”,
    “displaymodified”,
    “*categories_str”,
    “author”,
    “*post_thumbnail_href_str”,
    “*post_href_str”,
    “snippet_s”
    ],
    “query”: {
    “function_score”: {
    “functions”: [
    {
    “filter”: {
    “match”: {
    “product_visibility_str”: “featured”
    }
    },
    “weight”: 10
    }
    ],
    “query”: {
    “bool”: {
    “must”: {
    “query_string”: {
    “fields”: [
    “title^10”,
    “product_visibility_t^10”,
    “publication_date_t^15”,
    “summary_t”,
    “figures_str”,
    “tables_str”,
    “contents_str”,
    “synopsis_str”,
    “content^0.5”
    ],
    “query”: “(*)”,
    “default_operator”: “AND”
    }
    },
    “filter”: {
    “bool”: {
    “must”: [
    {
    “bool”: {
    “must_not”: [
    {
    “terms”: {
    “post_status_s”: [
    “draft”,
    “pending”,
    “trash”,
    “future”,
    “private”,
    “auto-draft”
    ]
    }
    }
    ]
    }
    },
    {
    “bool”: {
    “must”: [
    {
    “bool”: {
    “must”: [
    {
    “terms”: {
    “non_flat_hierarchy_industry_str”: [
    “Technology”
    ]
    }
    }
    ]
    }
    },
    {
    “bool”: {
    “must”: {
    “term”: {
    “non_flat_hierarchy_industry_str”: “Technology”
    }
    }
    }
    }
    ]
    }
    },
    ……

    wpsolr
    Keymaster
    1 year, 6 months ago #31205

    In your query, there are no keywords: it is not possible to test a search.

    1 year, 6 months ago #31206

    okay, here is with the search query :
    {
    “from”: 0,
    “size”: 20,
    “track_total_hits”: true,
    “highlight”: {
    “require_field_match”: false,
    “pre_tags”: [“”],
    “post_tags”: [“<\/b>”],
    “fields”: {
    “title”: {
    “fragment_size”: 100,
    “number_of_fragments”: 1
    }
    }
    },
    “_source”: [“id”, “PID”, “type”, “meta_type_s”, “title”, “numcomments”, “comments”, “displaydate”, “displaymodified”, “*categories_str”, “author”, “*post_thumbnail_href_str”, “*post_href_str”, “snippet_s”],
    “query”: {
    “function_score”: {
    “functions”: [{
    “filter”: {
    “match”: {
    “product_visibility_str”: “featured”
    }
    },
    “weight”: 11
    }],
    “query”: {
    “bool”: {
    “must”: {
    “query_string”: {
    “fields”: [“product_visibility_t^11”, “publication_date_t^12”, “title^10”, “summary_t”, “figures_str”, “tables_str”, “contents_str”, “synopsis_str”, “content^0.5”],
    “query”: “(retail~1)”,
    “default_operator”: “AND”
    }
    },
    “filter”: {
    “bool”: {
    “must”: [{
    “bool”: {
    “must_not”: [{
    “terms”: {
    “post_status_s”: [“draft”, “pending”, “trash”, “future”, “private”, “auto-draft”]
    }
    }]
    }
    }, {
    “bool”: {
    “must_not”: [{
    “terms”: {
    “type”: [“shop_order”]
    }
    }]
    }
    },

    wpsolr
    Keymaster
    1 year, 6 months ago #31207

    your query is now “retail~1”, which means “retail” with fuzzy search.
    What should it return, and what does it return?

    (remove the fuzzy option first, as it can have some strange effects).

    1 year, 6 months ago #31234

    with fuzzy search turned on, I am not able to search post content [custom acf fields], and fuzzy search is needed too as I need search to also match common spelling mistakes, How can I make this both work ?
    As we want search to also look for keywords in title, content and custom acf fields which we indexed, and provide better matching results.

    wpsolr
    Keymaster
    1 year, 6 months ago #31236

    Which field contains “retail” in your current ACF fields queried?

    “fields”: [“product_visibility_t^11”, “publication_date_t^12”, “title^10”, “summary_t”, “figures_str”, “tables_str”, “contents_str”, “synopsis_str”, “content^0.5”],
    “query”: “(retail~1)”,

    1 year, 6 months ago #31237

    these all fields might contain the word retail :
    “title^10”, “summary_t”, “figures_str”, “tables_str”, “contents_str”, “synopsis_str”,

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

You must be logged in to reply to this topic.