vespa-engine / vespa

AI + Data, online. https://vespa.ai
https://vespa.ai
Apache License 2.0
5.85k stars 606 forks source link

Adding fields to fieldset degrades query results #27878

Closed eostis closed 1 year ago

eostis commented 1 year ago

Describe the bug A query with a fieldset "wpsolr_fieldset_title_description " containing 2 fields returns the expected result. The same query with a another fieldset "wpsolr_fieldset_all_fields" containing the same 2 fields plus other fields returns no results.

Environment (please complete the following information): Docker on MacOS

Vespa version v8.198.18

Additional context (schema and queries)

schema acceptance_random_a2f149c59437 {

    document acceptance_random_a2f149c59437 inherits acceptance_random_a2f149c59437_generated {
        # You can override below the content of schema acceptance_random_a2f149c59437_generated.sd

    }

    fieldset wpsolr_fieldset_title_description {
        fields: wpsolr_title, wpsolr_content
    }

    fieldset wpsolr_fieldset_all_fields {
        fields: wpsolr_title, wpsolr_content, wpsolr_text, wpsolr__id, wpsolr_id, wpsolr_title, wpsolr_post_status_s, wpsolr_content, wpsolr_snippet_s, wpsolr_author, wpsolr_author_s, wpsolr_post_author_s, wpsolr_type, wpsolr_meta_type_s, wpsolr_permalink, wpsolr_comments, wpsolr_categories, wpsolr_categories_str, wpsolr_category_str, wpsolr_tags, wpsolr_tags_str, wpsolr_post_tag_str, wpsolr_blog_name_str, wpsolr_post_thumbnail_href_str, wpsolr_post_href_str, wpsolr_title_s, wpsolr_post_sticky_s, wpsolr_is_excluded_s, wpsolr_flat_hierarchy_categories_str, wpsolr_non_flat_hierarchy_categories_str, wpsolr_wpsolr_date_custom_field_str, wpsolr_wpsolr_date_custom_field_slider_1_str, wpsolr_wpsolr_date_epoch_custom_field_str
        }

    rank-profile default {
        first-phase {
            expression: nativeRank(wpsolr_title, wpsolr_content, wpsolr_text, wpsolr__id, wpsolr_id, wpsolr_title, wpsolr_post_status_s, wpsolr_content, wpsolr_snippet_s, wpsolr_author, wpsolr_author_s, wpsolr_post_author_s, wpsolr_type, wpsolr_meta_type_s, wpsolr_permalink, wpsolr_comments, wpsolr_categories, wpsolr_categories_str, wpsolr_category_str, wpsolr_tags, wpsolr_tags_str, wpsolr_post_tag_str, wpsolr_blog_name_str, wpsolr_post_thumbnail_href_str, wpsolr_post_href_str, wpsolr_title_s, wpsolr_post_sticky_s, wpsolr_is_excluded_s, wpsolr_flat_hierarchy_categories_str, wpsolr_non_flat_hierarchy_categories_str, wpsolr_wpsolr_date_custom_field_str, wpsolr_wpsolr_date_custom_field_slider_1_str, wpsolr_wpsolr_date_epoch_custom_field_str)
            }
        }

    rank-profile bm25 inherits default {
        first-phase {
            expression: bm25(wpsolr_title)
            }
        }
}
schema acceptance_random_a2f149c59437_generated {

    document acceptance_random_a2f149c59437_generated {

        ##BEGIN_FIELDS
        field wpsolr_text type string {
                indexing: summary | index
                match {
                    gram
                    gram-size: 2
                }
                summary: dynamic
        }

        field wpsolr__id type string {
                indexing: summary | attribute
            }
                    field wpsolr_id type string {
                indexing: summary | attribute

            }
                    field wpsolr_PID type long {
                indexing: summary | attribute

            }
                    field wpsolr_PID_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_title type string {
                indexing: summary | index

                            match {
    gram
    gram-size: 2
}

                            summary: dynamic

            }
                    field wpsolr_post_status_s type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_content type string {
                indexing: summary | index

                            match {
    gram
    gram-size: 2
}

                            summary: dynamic

            }
                    field wpsolr_snippet_s type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_author type string {
                indexing: summary | attribute

            }
                    field wpsolr_author_s type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_post_author_s type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_type type string {
                indexing: summary | attribute

            }
                    field wpsolr_meta_type_s type string {
                indexing: summary | attribute

            }
                    field wpsolr_date type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt type long {
                indexing: summary | attribute

            }
                    field wpsolr_permalink type string {
                indexing: summary | attribute

            }
                    field wpsolr_comments type array<string> {
                indexing: summary | index

                            match {
    gram
    gram-size: 2
}

                            summary: dynamic

            }
                    field wpsolr_numcomments type long {
                indexing: summary | attribute

            }
                    field wpsolr_categories type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_categories_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_category_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_tags type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_tags_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_post_tag_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_blog_name_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_post_thumbnail_href_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_post_href_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_post_parent_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_title_s type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_menu_order_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_post_sticky_s type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr__y_i type long {
                indexing: summary | attribute

            }
                    field wpsolr__ym_i type long {
                indexing: summary | attribute

            }
                    field wpsolr__yw_i type long {
                indexing: summary | attribute

            }
                    field wpsolr__yd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr__md_i type long {
                indexing: summary | attribute

            }
                    field wpsolr__wd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr__dh_i type long {
                indexing: summary | attribute

            }
                    field wpsolr__dm_i type long {
                indexing: summary | attribute

            }
                    field wpsolr__ds_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_blob_b64 type raw {
                indexing: summary

            }
                    field wpsolr_is_excluded_s type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_y_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_ym_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_yw_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_yd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_md_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_wd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_dh_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_dm_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaymodified_dt_ds_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_y_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_ym_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_yw_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_yd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_md_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_wd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_dh_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_dm_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dt_ds_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_y_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_ym_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_yw_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_yd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_md_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_wd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_dh_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_dm_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_date_ds_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_y_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_ym_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_yw_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_yd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_md_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_wd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dh_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_dm_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_displaydate_ds_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_y_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_ym_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_yw_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_yd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_md_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_wd_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_dh_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_dm_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_modified_ds_i type long {
                indexing: summary | attribute

            }
                    field wpsolr_flat_hierarchy_categories_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_non_flat_hierarchy_categories_str type array<string> {
                indexing: summary | attribute

            }

                    field wpsolr_my_cpt_tag_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_flat_hierarchy_my_cpt_tag_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_non_flat_hierarchy_my_cpt_tag_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_my_cpt_category_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_flat_hierarchy_my_cpt_category_str type array<string> {
                indexing: summary | attribute

            }
                    field wpsolr_non_flat_hierarchy_my_cpt_category_str type array<string> {
                indexing: summary | attribute

            }

                    field wpsolr_wpsolr_date_custom_field_str type array<string> {
                indexing: summary | attribute

            }

        ##END_FIELDS

    }

}

Query on fieldset "wpsolr_fieldset_all_fields" returning nothing:

{"offset":0,"limit":10,"query":"single quote'","yql":"select * from acceptance_random_a2f149c59437 where [{\"defaultIndex\":\"wpsolr_fieldset_all_fields\"}]userInput(@query)"}

Same query on fieldset "wpsolr_fieldset_all_fields" returning one result as expected:

{"offset":0,"limit":10,"query":"single quote'","yql":"select * from acceptance_random_a2f149c59437 where [{\"defaultIndex\":\"wpsolr_fieldset_title_description\"}]userInput(@query)"}

==>

{ "results": { "id": "toplevel", "relevance": 1, "fields": { "totalCount": 1 }, "coverage": { "coverage": 100, "documents": 302, "full": true, "nodes": 1, "results": 1, "resultsFull": 1 }, "children": [ { "id": "index:wpsolr\/0\/a8c88a008776fdb550d5abec", "relevance": 0, "source": "wpsolr", "fields": { "wpsolr_content": "<hi>single<\/hi> <hi>quote<\/hi>", "wpsolr_title": "post with <hi>single<\/hi> <hi>quote<\/hi>'", ...}}
jobergum commented 1 year ago

I bet you get a deployment warning about the mismatch in match settings between the fields you include in the fieldsets. Fields bundled in a fieldset must have the same match settings, implicit (defaults) or explicit. This is because the query can only be transformed with one setting.

jobergum commented 1 year ago

There is query tracing that can help understand how a query is parsed. Example request, reference doc

eostis commented 1 year ago

Thanks. I'm trying without the match { gram gram-size: 2 } ...

How can I search in fields with mismatch match settings?

eostis commented 1 year ago

The deployment is done by calling the Vespa's REST API from WordPress's backend, and I'll add a check on the session id status:

image

I have configured the trace mode, but the traces does not show errors or warnings:

{
  "results": {
    "id": "toplevel",
    "relevance": 1,
    "fields": {
      "totalCount": 0
    },
    "coverage": {
      "coverage": 100,
      "documents": 302,
      "full": true,
      "nodes": 1,
      "results": 1,
      "resultsFull": 1
    },
    "children": [
      {
        "id": "group:root:0",
        "relevance": 1,
        "continuation": {
          "this": ""
        }
      }
    ]
  },
  "trace": {
    "children": [
      {
        "message": "No query profile is used"
      },
      {
        "message": "Invoking chain 'vespa' [com.yahoo.prelude.statistics.StatisticsSearcher@native -> com.yahoo.prelude.querytransform.PhrasingSearcher@vespa -> ... -> federation@native]"
      },
      {
        "children": [
          {
            "message": "Field 'wpsolr_type' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_type' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_type' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_post_status_s' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_post_status_s' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_post_status_s' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_post_status_s' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_post_status_s' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_post_status_s' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_is_excluded_s' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Field 'wpsolr_is_excluded_s' is an attribute, 'contains' will only match exactly (unless fuzzy is used)"
          },
          {
            "message": "Query parsed to: select * from sources * where weakAnd(default contains \"single\", default contains \"quote\")"
          },
          {
            "message": "YQL+ query parsed: [select wpsolr_snippet_s, wpsolr_displaymodified, wpsolr_type, wpsolr_title, wpsolr_numcomments, wpsolr_author, wpsolr_PID, wpsolr_meta_type_s, wpsolr_displaydate, wpsolr_content, wpsolr_comments, wpsolr_id from acceptance_random_a2f149c59437 where (((wpsolr_type contains ({stem: false}\"post\") OR wpsolr_type contains ({stem: false}\"page\") OR wpsolr_type contains ({stem: false}\"my-cpt\")) AND ((true) AND !((true) AND !(wpsolr_is_excluded_s contains ({stem: false}\"_wpsolr_undefined\"))) OR wpsolr_is_excluded_s contains ({stem: false}\"n\")) AND weakAnd(wpsolr_fieldset_all_fields contains \"single\", wpsolr_fieldset_all_fields contains \"quote\"))) AND !((wpsolr_post_status_s contains ({stem: false}\"draft\") OR wpsolr_post_status_s contains ({stem: false}\"pending\") OR wpsolr_post_status_s contains ({stem: false}\"trash\") OR wpsolr_post_status_s contains ({stem: false}\"future\") OR wpsolr_post_status_s contains ({stem: false}\"private\") OR wpsolr_post_status_s contains ({stem: false}\"auto-draft\"))) order by wpsolr_PID_i | all(all(group(wpsolr_type) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_author) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_categories_str) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_tags) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_my_cpt_tag_str) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_my_cpt_category_str) max(100) order(neg(count())) each(output(count()))))]"
          },
          {
            "message": "Federating to [wpsolr]"
          },
          {
            "children": [
              {
                "message": "Stemming with language=ENGLISH"
              },
              {
                "message": "Stemming: [select wpsolr_snippet_s, wpsolr_displaymodified, wpsolr_type, wpsolr_title, wpsolr_numcomments, wpsolr_author, wpsolr_PID, wpsolr_meta_type_s, wpsolr_displaydate, wpsolr_content, wpsolr_comments, wpsolr_id from acceptance_random_a2f149c59437 where (((wpsolr_type contains ({stem: false}\"post\") OR wpsolr_type contains ({stem: false}\"page\") OR wpsolr_type contains ({stem: false}\"my-cpt\")) AND ((true) AND !((true) AND !(wpsolr_is_excluded_s contains ({stem: false}\"_wpsolr_undefined\"))) OR wpsolr_is_excluded_s contains ({stem: false}\"n\")) AND weakAnd(wpsolr_fieldset_all_fields contains \"single\", wpsolr_fieldset_all_fields contains \"quote\"))) AND !((wpsolr_post_status_s contains ({stem: false}\"draft\") OR wpsolr_post_status_s contains ({stem: false}\"pending\") OR wpsolr_post_status_s contains ({stem: false}\"trash\") OR wpsolr_post_status_s contains ({stem: false}\"future\") OR wpsolr_post_status_s contains ({stem: false}\"private\") OR wpsolr_post_status_s contains ({stem: false}\"auto-draft\"))) order by wpsolr_PID_i timeout 494 | all(all(group(wpsolr_type) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_author) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_categories_str) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_tags) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_my_cpt_tag_str) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_my_cpt_category_str) max(100) order(neg(count())) each(output(count()))))]"
              },
              {
                "message": "Lowercasing: [select wpsolr_snippet_s, wpsolr_displaymodified, wpsolr_type, wpsolr_title, wpsolr_numcomments, wpsolr_author, wpsolr_PID, wpsolr_meta_type_s, wpsolr_displaydate, wpsolr_content, wpsolr_comments, wpsolr_id from acceptance_random_a2f149c59437 where (((wpsolr_type contains ({stem: false, normalizeCase: false}\"post\") OR wpsolr_type contains ({stem: false, normalizeCase: false}\"page\") OR wpsolr_type contains ({stem: false, normalizeCase: false}\"my-cpt\")) AND ((true) AND !((true) AND !(wpsolr_is_excluded_s contains ({stem: false, normalizeCase: false}\"_wpsolr_undefined\"))) OR wpsolr_is_excluded_s contains ({stem: false, normalizeCase: false}\"n\")) AND weakAnd(wpsolr_fieldset_all_fields contains ({normalizeCase: false}\"single\"), wpsolr_fieldset_all_fields contains ({normalizeCase: false}\"quote\")))) AND !((wpsolr_post_status_s contains ({stem: false, normalizeCase: false}\"draft\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false}\"pending\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false}\"trash\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false}\"future\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false}\"private\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false}\"auto-draft\"))) order by wpsolr_PID_i timeout 494 | all(all(group(wpsolr_type) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_author) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_categories_str) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_tags) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_my_cpt_tag_str) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_my_cpt_category_str) max(100) order(neg(count())) each(output(count()))))]"
              },
              {
                "message": "Grouping in 1 passes. SessionId='null'."
              },
              {
                "message": "sc0.num0 search to dispatch: query=[+(AND (OR wpsolr_type:post wpsolr_type:page wpsolr_type:my-cpt) (OR (-(-wpsolr_is_excluded_s:_wpsolr_undefined)) wpsolr_is_excluded_s:n) (WEAKAND(100) wpsolr_fieldset_all_fields:single wpsolr_fieldset_all_fields:quote)) -(OR wpsolr_post_status_s:draft wpsolr_post_status_s:pending wpsolr_post_status_s:trash wpsolr_post_status_s:future wpsolr_post_status_s:private wpsolr_post_status_s:auto-draft)] timeout=494ms offset=0 hits=10 sortspec=[ASCENDING:wpsolr_PID_i] groupingSessionCache=true sessionId=72736e39-4ca6-46cd-81d8-d9c693a8d241.1690217326769.299.default grouping=6 : Grouping {\n classId: 16475\n id: 0\n valid: true\n all: false\n topN: -1\n firstLevel: 0\n lastLevel: 1\n groupingLevels: List {\n [0]: GroupingLevel {\n classId: 16477\n maxGroups: 101\n precision: 200\n classify: AttributeNode {\n classId: 16439\n result: <NULL>\n attribute: 'wpsolr_type'\n }\n collect: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n [0]: CountAggregationResult {\n classId: 16465\n expression: ConstantNode {\n classId: 16433\n value: IntegerResultNode {\n classId: 16491\n value: 0\n }\n }\n tag: 3\n count: 0\n }\n }\n orderby-idx: List {\n [0]: -1\n }\n orderby-exp: List {\n [0]: AggregationRefNode {\n classId: 16526\n index: 0\n }\n }\n children: List {\n }\n tag: 2\n }\n }\n }\n root: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n }\n orderby-idx: List {\n }\n orderby-exp: List {\n }\n children: List {\n }\n tag: 1\n }\n}\nGrouping {\n classId: 16475\n id: 1\n valid: true\n all: false\n topN: -1\n firstLevel: 0\n lastLevel: 1\n groupingLevels: List {\n [0]: GroupingLevel {\n classId: 16477\n maxGroups: 101\n precision: 200\n classify: AttributeNode {\n classId: 16439\n result: <NULL>\n attribute: 'wpsolr_author'\n }\n collect: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n [0]: CountAggregationResult {\n classId: 16465\n expression: ConstantNode {\n classId: 16433\n value: IntegerResultNode {\n classId: 16491\n value: 0\n }\n }\n tag: 5\n count: 0\n }\n }\n orderby-idx: List {\n [0]: -1\n }\n orderby-exp: List {\n [0]: AggregationRefNode {\n classId: 16526\n index: 0\n }\n }\n children: List {\n }\n tag: 4\n }\n }\n }\n root: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n }\n orderby-idx: List {\n }\n orderby-exp: List {\n }\n children: List {\n }\n tag: 1\n }\n}\nGrouping {\n classId: 16475\n id: 2\n valid: true\n all: false\n topN: -1\n firstLevel: 0\n lastLevel: 1\n groupingLevels: List {\n [0]: GroupingLevel {\n classId: 16477\n maxGroups: 101\n precision: 200\n classify: AttributeNode {\n classId: 16439\n result: <NULL>\n attribute: 'wpsolr_categories_str'\n }\n collect: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n [0]: CountAggregationResult {\n classId: 16465\n expression: ConstantNode {\n classId: 16433\n value: IntegerResultNode {\n classId: 16491\n value: 0\n }\n }\n tag: 7\n count: 0\n }\n }\n orderby-idx: List {\n [0]: -1\n }\n orderby-exp: List {\n [0]: AggregationRefNode {\n classId: 16526\n index: 0\n }\n }\n children: List {\n }\n tag: 6\n }\n }\n }\n root: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n }\n orderby-idx: List {\n }\n orderby-exp: List {\n }\n children: List {\n }\n tag: 1\n }\n}\nGrouping {\n classId: 16475\n id: 3\n valid: true\n all: false\n topN: -1\n firstLevel: 0\n lastLevel: 1\n groupingLevels: List {\n [0]: GroupingLevel {\n classId: 16477\n maxGroups: 101\n precision: 200\n classify: AttributeNode {\n classId: 16439\n result: <NULL>\n attribute: 'wpsolr_tags'\n }\n collect: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n [0]: CountAggregationResult {\n classId: 16465\n expression: ConstantNode {\n classId: 16433\n value: IntegerResultNode {\n classId: 16491\n value: 0\n }\n }\n tag: 9\n count: 0\n }\n }\n orderby-idx: List {\n [0]: -1\n }\n orderby-exp: List {\n [0]: AggregationRefNode {\n classId: 16526\n index: 0\n }\n }\n children: List {\n }\n tag: 8\n }\n }\n }\n root: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n }\n orderby-idx: List {\n }\n orderby-exp: List {\n }\n children: List {\n }\n tag: 1\n }\n}\nGrouping {\n classId: 16475\n id: 4\n valid: true\n all: false\n topN: -1\n firstLevel: 0\n lastLevel: 1\n groupingLevels: List {\n [0]: GroupingLevel {\n classId: 16477\n maxGroups: 101\n precision: 200\n classify: AttributeNode {\n classId: 16439\n result: <NULL>\n attribute: 'wpsolr_my_cpt_tag_str'\n }\n collect: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n [0]: CountAggregationResult {\n classId: 16465\n expression: ConstantNode {\n classId: 16433\n value: IntegerResultNode {\n classId: 16491\n value: 0\n }\n }\n tag: 11\n count: 0\n }\n }\n orderby-idx: List {\n [0]: -1\n }\n orderby-exp: List {\n [0]: AggregationRefNode {\n classId: 16526\n index: 0\n }\n }\n children: List {\n }\n tag: 10\n }\n }\n }\n root: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n }\n orderby-idx: List {\n }\n orderby-exp: List {\n }\n children: List {\n }\n tag: 1\n }\n}\nGrouping {\n classId: 16475\n id: 5\n valid: true\n all: false\n topN: -1\n firstLevel: 0\n lastLevel: 1\n groupingLevels: List {\n [0]: GroupingLevel {\n classId: 16477\n maxGroups: 101\n precision: 200\n classify: AttributeNode {\n classId: 16439\n result: <NULL>\n attribute: 'wpsolr_my_cpt_category_str'\n }\n collect: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n [0]: CountAggregationResult {\n classId: 16465\n expression: ConstantNode {\n classId: 16433\n value: IntegerResultNode {\n classId: 16491\n value: 0\n }\n }\n tag: 13\n count: 0\n }\n }\n orderby-idx: List {\n [0]: -1\n }\n orderby-exp: List {\n [0]: AggregationRefNode {\n classId: 16526\n index: 0\n }\n }\n children: List {\n }\n tag: 12\n }\n }\n }\n root: Group {\n classId: 16474\n id: <NULL>\n rank: 0.0\n aggregationresults: List {\n }\n orderby-idx: List {\n }\n orderby-exp: List {\n }\n children: List {\n }\n tag: 1\n }\n}\n restrict=[acceptance_random_a2f149c59437]"
              },
              {
                "message": "Current state of query tree: NOT{\n AND{\n OR{\n EXACTSTRING[fromSegmented=false index=\"wpsolr_type\" origin=null segmentIndex=0 stemmed=true uniqueID=1 words=true]{\n \"post\"\n }\n EXACTSTRING[fromSegmented=false index=\"wpsolr_type\" origin=null segmentIndex=0 stemmed=true uniqueID=2 words=true]{\n \"page\"\n }\n EXACTSTRING[fromSegmented=false index=\"wpsolr_type\" origin=null segmentIndex=0 stemmed=true uniqueID=3 words=true]{\n \"my-cpt\"\n }\n }\n OR{\n NOT{\n TRUE\n NOT{\n TRUE\n EXACTSTRING[fromSegmented=false index=\"wpsolr_is_excluded_s\" origin=null segmentIndex=0 stemmed=true uniqueID=4 words=true]{\n \"_wpsolr_undefined\"\n }\n }\n }\n EXACTSTRING[fromSegmented=false index=\"wpsolr_is_excluded_s\" origin=null segmentIndex=0 stemmed=true uniqueID=5 words=true]{\n \"n\"\n }\n }\n WEAKAND[N=100]{\n WORD[fromSegmented=false index=\"wpsolr_fieldset_all_fields\" origin=\"(0 6)\" segmentIndex=0 stemmed=false uniqueID=6 words=true]{\n \"single\"\n }\n WORD[fromSegmented=false index=\"wpsolr_fieldset_all_fields\" origin=\"(7 12)\" segmentIndex=0 stemmed=false uniqueID=7 words=true]{\n \"quote\"\n }\n }\n }\n OR{\n EXACTSTRING[fromSegmented=false index=\"wpsolr_post_status_s\" origin=null segmentIndex=0 stemmed=true uniqueID=8 words=true]{\n \"draft\"\n }\n EXACTSTRING[fromSegmented=false index=\"wpsolr_post_status_s\" origin=null segmentIndex=0 stemmed=true uniqueID=9 words=true]{\n \"pending\"\n }\n EXACTSTRING[fromSegmented=false index=\"wpsolr_post_status_s\" origin=null segmentIndex=0 stemmed=true uniqueID=10 words=true]{\n \"trash\"\n }\n EXACTSTRING[fromSegmented=false index=\"wpsolr_post_status_s\" origin=null segmentIndex=0 stemmed=true uniqueID=11 words=true]{\n \"future\"\n }\n EXACTSTRING[fromSegmented=false index=\"wpsolr_post_status_s\" origin=null segmentIndex=0 stemmed=true uniqueID=12 words=true]{\n \"private\"\n }\n EXACTSTRING[fromSegmented=false index=\"wpsolr_post_status_s\" origin=null segmentIndex=0 stemmed=true uniqueID=13 words=true]{\n \"auto-draft\"\n }\n }\n}\n"
              },
              {
                "message": "YQL+ representation: select wpsolr_snippet_s, wpsolr_displaymodified, wpsolr_type, wpsolr_title, wpsolr_numcomments, wpsolr_author, wpsolr_PID, wpsolr_meta_type_s, wpsolr_displaydate, wpsolr_content, wpsolr_comments, wpsolr_id from acceptance_random_a2f149c59437 where (((wpsolr_type contains ({stem: false, normalizeCase: false, id: 1}\"post\") OR wpsolr_type contains ({stem: false, normalizeCase: false, id: 2}\"page\") OR wpsolr_type contains ({stem: false, normalizeCase: false, id: 3}\"my-cpt\")) AND ((true) AND !((true) AND !(wpsolr_is_excluded_s contains ({stem: false, normalizeCase: false, id: 4}\"_wpsolr_undefined\"))) OR wpsolr_is_excluded_s contains ({stem: false, normalizeCase: false, id: 5}\"n\")) AND weakAnd(wpsolr_fieldset_all_fields contains ({normalizeCase: false, id: 6}\"single\"), wpsolr_fieldset_all_fields contains ({normalizeCase: false, id: 7}\"quote\")))) AND !((wpsolr_post_status_s contains ({stem: false, normalizeCase: false, id: 8}\"draft\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false, id: 9}\"pending\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false, id: 10}\"trash\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false, id: 11}\"future\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false, id: 12}\"private\") OR wpsolr_post_status_s contains ({stem: false, normalizeCase: false, id: 13}\"auto-draft\"))) order by wpsolr_PID_i timeout 494 | all(all(group(wpsolr_type) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_author) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_categories_str) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_tags) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_my_cpt_tag_str) max(100) order(neg(count())) each(output(count()))) all(group(wpsolr_my_cpt_category_str) max(100) order(neg(count())) each(output(count()))))"
              },
              {
                "message": "Dispatching to search node key = 0 hostname = node1.vespanet path = 0 in group 0 statusIsKnown = true working = true activeDocs = 1510 targetActiveDocs = 1510"
              },
              {
                "message": [
                  {
                    "start_time": "2023-07-24 16:48:46.772 UTC",
                    "distribution-key": 0,
                    "document-type": "acceptance_random_a2f149c59437",
                    "duration_ms": 0.684588
                  }
                ]
              },
              {
                "message": "sc0.num0 dispatch response: Result (0 of total 0 hits)"
              }
            ]
          },
          {
            "message": "Ignoring fill(null): Hits are unfillable: result.hits().getFilled()=null"
          },
          {
            "message": "Query time query '+(AND (OR wpsolr_type:post wpsolr_type:page wpsolr_type:my-cpt) (OR (-(-wpsolr_is_excluded_s:_wpsolr_undefined)) wpsolr_is_excluded_s:n) (WEAKAND(100) wpsolr_fieldset_all_fields:single wpsolr_fieldset_all_fields:quote)) -(OR wpsolr_post_status_s:draft wpsolr_post_status_s:pending wpsolr_post_status_s:trash wpsolr_post_status_s:future wpsolr_post_status_s:private wpsolr_post_status_s:auto-draft)': 13 ms"
          },
          {
            "message": "Summary fetch time query '+(AND (OR wpsolr_type:post wpsolr_type:page wpsolr_type:my-cpt) (OR (-(-wpsolr_is_excluded_s:_wpsolr_undefined)) wpsolr_is_excluded_s:n) (WEAKAND(100) wpsolr_fieldset_all_fields:single wpsolr_fieldset_all_fields:quote)) -(OR wpsolr_post_status_s:draft wpsolr_post_status_s:pending wpsolr_post_status_s:trash wpsolr_post_status_s:future wpsolr_post_status_s:private wpsolr_post_status_s:auto-draft)': 0 ms"
          }
        ]
      }
    ]
  }
}
image image
jobergum commented 1 year ago

Sorry, but if you need further input on this you will need to dumb down this to something less verbose than all that.

eostis commented 1 year ago

Indeed, can we search in fields with mismatch match settings?

(removing the match {} on fields solved the issue)

eostis commented 1 year ago

Solved with #27880: just clone fields with specific match{} property, and use clones in a specific fieldset.

Thanks!