Closed eostis closed 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.
There is query tracing that can help understand how a query is parsed. Example request, reference doc
Thanks. I'm trying without the match { gram gram-size: 2 }
...
How can I search in fields with mismatch match settings?
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:
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"
}
]
}
]
}
}
Sorry, but if you need further input on this you will need to dumb down this to something less verbose than all that.
Indeed, can we search in fields with mismatch match settings?
(removing the match {} on fields solved the issue)
Solved with #27880: just clone fields with specific match{} property, and use clones in a specific fieldset.
Thanks!
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)
Query on fieldset "wpsolr_fieldset_all_fields" returning nothing:
Same query on fieldset "wpsolr_fieldset_all_fields" returning one result as expected: