{"id":4422,"date":"2016-06-09T12:37:10","date_gmt":"2016-06-09T12:37:10","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=4422"},"modified":"2016-06-09T12:37:10","modified_gmt":"2016-06-09T12:37:10","slug":"explain-in-solr","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/explain-in-solr\/","title":{"rendered":"&#8220;Explain&#8221; and &#8220;Analyze&#8221; in Solr"},"content":{"rendered":"<p>If you add &#8220;&#038;debugQuery=true&#8221; to the URL, you&#8217;ll get a JSON payload back for each row, which gives you the score computation, like so:<\/p>\n<p>For solr, how ranking is computed is often more interesting than performance, but the same concepts for having a computation tree apply&#8221;<\/p>\n<pre>\n\"ad7b44e1-44d5-4df1-a0fe-729633010c98\": \"\n5.023878 = sum of:\n  4.100354 = weight(talk_day_i:`\\b\\u0000\\u0000\\u0000\\u0004 in 5) [ClassicSimilarity], result of:\n    4.100354 = score(doc=5,freq=1.0), product of:\n      0.972982 = queryWeight, product of:\n        4.214214 = idf(docFreq=85, maxDocs=2140)\n        0.23088102 = queryNorm\n      4.214214 = fieldWeight in 5, product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 = termFreq=1.0\n        4.214214 = idf(docFreq=85, maxDocs=2140)\n        1.0 = fieldNorm(doc=5)\n  0.9235241 = FunctionQuery(int(talk_day_i)), product of:\n    4.0 = int(talk_day_i)=4\n    0.23088102 = boost\n    1.0 = queryNorm\n<\/pre>\n<p>You do also get the equivalent of analyze, and some information about how the query was prepared:<\/p>\n<pre>\n    \"rawquerystring\": \"talk_day_i:4\",\n    \"querystring\": \"talk_day_i:4\",\n    \"parsedquery\": \"(+talk_day_i:4 FunctionQuery(int(talk_day_i)))\/no_coord\",\n    \"parsedquery_toString\": \"+talk_day_i:`\\b\\u0000\\u0000\\u0000\\u0004 int(talk_day_i)\",\n    \"explain\": {\n      ...\n    },\n    \"QParser\": \"ExtendedDismaxQParser\",\n    \"altquerystring\": null,\n    \"boost_queries\": null,\n    \"parsed_boost_queries\": [],\n    \"boostfuncs\": [\n      \"talk_day_i\"\n    ],\n    \"timing\": {\n      \"time\": 39,\n      \"prepare\": {\n        \"time\": 0,\n        \"query\": {\n          \"time\": 0\n        },\n        \"facet\": {\n          \"time\": 0\n        },\n        \"facet_module\": {\n          \"time\": 0\n        },\n        \"mlt\": {\n          \"time\": 0\n        },\n        \"highlight\": {\n          \"time\": 0\n        },\n        \"stats\": {\n          \"time\": 0\n        },\n        \"expand\": {\n          \"time\": 0\n        },\n        \"debug\": {\n          \"time\": 0\n        }\n      },\n      \"process\": {\n        \"time\": 38,\n        \"query\": {\n          \"time\": 0\n        },\n        \"facet\": {\n          \"time\": 0\n        },\n        \"facet_module\": {\n          \"time\": 0\n        },\n        \"mlt\": {\n          \"time\": 0\n        },\n        \"highlight\": {\n          \"time\": 0\n        },\n        \"stats\": {\n          \"time\": 0\n        },\n        \"expand\": {\n          \"time\": 0\n        },\n        \"debug\": {\n          \"time\": 38\n        }\n      }\n    }\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to get debugging information from Solr<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[517],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/4422"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=4422"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/4422\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=4422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=4422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=4422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}