Debugging SOLR Query
Is there a way to debug the SOLR query that is being executed when invoking Broadleaf's Search Services?
There is a request parameter you can pass to the search service to get the exact query used on a search request: &debug=true
.
It returns a JSON string with all the data returned from SOLR, and the parameter queryUrl
is in that JSON string. You can then paste that string into SOLR admin and perform the same request.
Example:
curl -X 'GET' \ 'https://admin.blcdemo.com/api/search/catalog-search?query=hot&type=PRODUCT&debug=true&page=0&size=50' \ -H 'accept: application/json' \ -H 'X-Context-Request: { "applicationId": "my_application_id", "tenantId": "my_tenant_id" }' \ -H 'Authorization: Bearer eyJhbGciOi...'<br>
May return a result similar to this:
Notice the "debug" parameter with the queryUrl
{ "content": [ { ... "description": "<p>This Bundle packages our two Bull Snort brand hot sauces together. You get one Cowboy Cayenne Pepper Hot Sauce and two Smokin' Toncils Hot Sauce, all for a reduced price!</p>", "name": "Bull Snort Hot Sauce Bundle", "id": "01F9Y5WK44030D00551EPJ1Q3F", ... }, { ... "description": "Tangy, ripe cayenne peppers flow together with garlic, onion, tomato paste and a hint of cane sugar to make this a smooth sauce with a bite. Wonderful on eggs, poultry, pork, or fish, this sauce blends to make rich marinades and soups.", "name": "Hoppin' Hot Sauce", "id": "product4", ... }, ... ], "pageable": { ... }, "facets": [ ... ], "sorts": [ ... ], "correctedQuery": false, "debug": "{\n \"responseHeader\" : {\n \"zkConnected\" : true,\n \"status\" : 0,\n \"QTime\" : 20,\n \"params\" : {\n \"spellcheck.collateExtendedResults\" : \"true\",\n \"fl\" : \"optionLabel_s,optionName_s,optionValue_s,catalog_s,trackingLevel_i,sandboxOwner_s,sandbox_s,searchableAdvancedTags_ss_en_US,attributeTagFacets_ss_en_US,discountTagFacets_ss_en_US,genericTagFacets_ss_en_US,featureTagFacets_ss_en_US,price_money,brandId_s,targetDemographicId_s,merchandisingTypeId_s,brandDisplayValue_s_en_US,targetDemographicDisplayValue_s_en_US,merchandisingTypeDisplayValue_s_en_US,tags_ss_en_US,tags_txt_en_US,vendorRef_s,availableOnline_b,sku_s,explicitCategoryNames_ss_en_US,explicitCategoryIds_ss,primaryCategoryName_s_en_US,categoryNames_ss_en_US,keywords_ss_en_US,primaryAssetType_s,primaryAssetAltText_s_en_US,primaryCategoryId_s,categoryIds_ss,currency_currency,primaryAssetTags_ss,primaryAssetContentTitle_s,primaryAssetContentUrl_s,uri_s,description_t_en_US,name_s_en_US,contextId_s\",\n \"spellcheck.maxCollations\" : \"1\",\n \"fq\" : [ \"((*:* AND -inventoryCheckRequired_b:true) OR inventoryAvailableForApplicationScopes_ss:PD_demo37mu1z OR inventoryAvailableForTenantScope_s:5DF1363059675161A85F576D)\", \"-catalogOverrides_ss:(3 OR PD_CATALOG_DEMO37MU1Z)\", \"(catalog_s:(3 PD_CATALOG_DEMO37MU1Z) OR (*:* AND -catalog_s:*))\", \"(trackingLevel_i:100000)\", \"tenant_s:5DF1363059675161A85F576D\", \"activeStartDate_dt:[* TO 2022-04-01T13:31:16.816Z]\", \"-activeEndDate_dt:[* TO 2022-04-01T13:31:16.816Z]\" ],\n \"spellcheck.maxCollationTries\" : \"1\",\n \"defType\" : \"edismax\",\n \"spellcheck.q\" : \"hot\",\n \"f.phrase_exact.qf\" : \"tags_ss_en_US tags_txt_en_US description_t_en_US name_t_en_US^3.0\",\n \"qf\" : \"id\",\n \"facet.interval\" : \"price_money\",\n \"f.price_money.facet.interval.set\" : [ \"[0,10]\", \"[10,*]\" ],\n \"facet.field\" : [ \"attributeTagFacets_ss_en_US\", \"discountTagFacets_ss_en_US\", \"genericTagFacets_ss_en_US\", \"featureTagFacets_ss_en_US\", \"brandDisplayValue_s_en_US\", \"targetDemographicDisplayValue_s_en_US\", \"merchandisingTypeDisplayValue_s_en_US\" ],\n \"_stateVer_\" : \"catalog_collection_1:23\",\n \"start\" : \"0\",\n \"rows\" : \"50\",\n \"version\" : \"2\",\n \"f.phrase.qf\" : \"tags_ss_en_US tags_txt_en_US description_t_en_US name_t_en_US^2.0\",\n \"f.word.qf\" : \"searchableAdvancedTags_ss_en_US^3.0 searchableAdvancedTags_txt_en_US searchableAdvancedTags_txt_part_en_US brandDisplayValue_s_en_US^10.0 merchandisingTypeDisplayValue_s_en_US^10.0 tags_ss_en_US^5.0 tags_txt_en_US categoryNames_ss_en_US description_t_en_US description_t_part_en_US description_tta_en_US description_ttas_en_US name_s_en_US^10.0 name_t_en_US^2.0 name_t_part_en_US name_tta_en_US name_ttas_en_US\",\n \"q\" : \"word:(hot)^2.0 || phrase_exact:(\\\"hot\\\")^4.0 || phrase:(\\\"hot\\\"~2)^3.0\",\n \"spellcheck\" : \"on\",\n \"facet.mincount\" : \"1\",\n \"spellcheck.count\" : \"1\",\n \"facet\" : \"true\",\n \"spellcheck.collate\" : \"true\",\n \"wt\" : \"json\"\n }\n },\n \"response\" : [ {\n \"contextId_s\" : \"01F9Y5WK44030D00551EPJ1Q3F\",\n \"price_money\" : 10.0,\n \"brandId_s\" : \"brand-bull-snort\",\n \"merchandisingTypeId_s\" : \"merchandisingType-hot-sauces\",\n \"explicitCategoryIds_ss\" : [ \"category1\" ],\n \"primaryAssetType_s\" : \"IMAGE\",\n \"categoryIds_ss\" : [ \"category3\", \"category1\" ],\n \"currency_currency\" : \"USD\",\n \"primaryAssetContentUrl_s\" : \"https://admin.blcdemo.com/api/asset/content/Bull-Snort-Bundle.jpg?contextRequest=%7B%22forceCatalogForFetch%22:false,%22tenantId%22:%225DF1363059675161A85F576D%22%7D\",\n \"uri_s\" : \"/hot-sauces/bull-snort-bundle\",\n \"brandDisplayValue_s_en_US\" : \"Bull Snort\",\n \"merchandisingTypeDisplayValue_s_en_US\" : \"Hot Sauces\",\n \"explicitCategoryNames_ss_en_US\" : [ \"Hot Sauces\" ],\n \"categoryNames_ss_en_US\" : [ \"Merchandise\", \"Hot Sauces\" ],\n \"primaryAssetAltText_s_en_US\" : \"Bull Snort Hot Sauce Bundle\",\n \"description_t_en_US\" : \"<p>This Bundle packages our two Bull Snort brand hot sauces together. You get one Cowboy Cayenne Pepper Hot Sauce and two Smokin' Toncils Hot Sauce, all for a reduced price!</p>\",\n \"name_s_en_US\" : \"Bull Snort Hot Sauce Bundle\",\n \"catalog_s\" : \"3\",\n \"trackingLevel_i\" : 100000\n }, {\n \"contextId_s\" : \"product4\",\n \"price_money\" : 8.99,\n \"merchandisingTypeId_s\" : \"merchandisingType-hot-sauces\",\n \"sku_s\" : \"HS-HHS-20\",\n \"explicitCategoryIds_ss\" : [ \"category7\", \"category1\" ],\n \"primaryAssetType_s\" : \"IMAGE\",\n \"categoryIds_ss\" : [ \"category7\", \"category3\", \"category1\" ],\n \"currency_currency\" : \"USD\",\n \"primaryAssetContentTitle_s\" : \"Bottle of Hoppin' Hot Sauce\",\n \"primaryAssetContentUrl_s\" : \"https://admin.blcdemo.com/api/asset/content/Hoppin-Hot-Sauce-Bottle.jpg?contextRequest=%7B%22forceCatalogForFetch%22:false,%22tenantId%22:%225DF1363059675161A85F576D%22%7D\",\n \"uri_s\" : \"/hot-sauces/hoppin-hot-sauce\",\n \"searchableAdvancedTags_ss_en_US\" : [ \"New\" ],\n \"attributeTagFacets_ss_en_US\" : [ \"New\" ],\n \"merchandisingTypeDisplayValue_s_en_US\" : \"Hot Sauces\",\n \"explicitCategoryNames_ss_en_US\" : [ \"Top Sellers\", \"Hot Sauces\" ],\n \"categoryNames_ss_en_US\" : [ \"Top Sellers\", \"Merchandise\", \"Hot Sauces\" ],\n \"primaryAssetAltText_s_en_US\" : \"Bottle of Hoppin' Hot Sauce\",\n \"description_t_en_US\" : \"Tangy, ripe cayenne peppers flow together with garlic, onion, tomato paste and a hint of cane sugar to make this a smooth sauce with a bite. Wonderful on eggs, poultry, pork, or fish, this sauce blends to make rich marinades and soups.\",\n \"name_s_en_US\" : \"Hoppin' Hot Sauce\",\n \"catalog_s\" : \"3\",\n \"trackingLevel_i\" : 100000\n }, {\n \"contextId_s\" : \"01FA39WERBABCQ0X3DMQTB1H33\",\n \"price_money\" : 17.0,\n \"brandId_s\" : \"brand-blairs\",\n \"merchandisingTypeId_s\" : \"merchandisingType-hot-sauces\",\n \"explicitCategoryIds_ss\" : [ \"category1\" ],\n \"primaryCategoryId_s\" : \"category1\",\n \"categoryIds_ss\" : [ \"category3\", \"category1\" ],\n \"currency_currency\" : \"USD\",\n \"uri_s\" : \"/hot-sauces/deathly-hot-sauce-bundle\",\n \"brandDisplayValue_s_en_US\" : \"Blair's\",\n \"merchandisingTypeDisplayValue_s_en_US\" : \"Hot Sauces\",\n \"explicitCategoryNames_ss_en_US\" : [ \"Hot Sauces\" ],\n \"primaryCategoryName_s_en_US\" : \"Hot Sauces\",\n \"categoryNames_ss_en_US\" : [ \"Merchandise\", \"Hot Sauces\" ],\n \"description_t_en_US\" : \"<p>Get 1 Sudden and 1 Sweet Death hot sauce in this bundle!</p>\",\n \"name_s_en_US\" : \"Deathly Hot Sauce Bundle\",\n \"catalog_s\" : \"3\",\n \"trackingLevel_i\" : 100000\n }, {\n \"contextId_s\" : \"01F9Y6WZB61AXN0BW05Z011ZWA\",\n \"price_money\" : 3.99,\n \"brandId_s\" : \"brand-bull-snort\",\n \"merchandisingTypeId_s\" : \"merchandisingType-hot-sauces\",\n \"sku_s\" : \"HS-ST-20\",\n \"explicitCategoryIds_ss\" : [ \"category1\" ],\n \"primaryAssetType_s\" : \"IMAGE\",\n \"categoryIds_ss\" : [ \"category3\", \"category1\" ],\n \"currency_currency\" : \"USD\",\n \"primaryAssetContentUrl_s\" : \"https://admin.blcdemo.com/api/asset/content/Bull-Snort-Smokin-Toncils-Hot-Sauce-Bottle.jpg?contextRequest=%7B%22forceCatalogForFetch%22:false,%22tenantId%22:%225DF1363059675161A85F576D%22%7D\",\n \"uri_s\" : \"/hot-sauces/bull-snort-smokin-toncils-hot-sauce\",\n \"brandDisplayValue_s_en_US\" : \"Bull Snort\",\n \"merchandisingTypeDisplayValue_s_en_US\" : \"Hot Sauces\",\n \"explicitCategoryNames_ss_en_US\" : [ \"Hot Sauces\" ],\n \"categoryNames_ss_en_US\" : [ \"Merchandise\", \"Hot Sauces\" ],\n \"primaryAssetAltText_s_en_US\" : \"Bottle of Smokin' Toncils Hot Sauce\",\n \"description_t_en_US\" : \"<p>Everything is bigger in Texas, even the burn of a Bull Snortin' Hot Sauce! shower on that Texas sized steak they call the Ole 96er or your plane Jane vegetables. If you are a fan on making BBQ sauce from scratch like I am, you can use Bull Snort Smokin' Tonsils Hot Sauce as an additive. Red hot habaneros and cayenne peppers give this tonsil tingler it's famous flavor and red hot heat. Bull Snort Smokin' Tonsils Hot Sauce'll have your bowels buckin' with just a drop!</p>\",\n \"name_s_en_US\" : \"Bull Snort Smokin' Toncils Hot Sauce\",\n \"catalog_s\" : \"3\",\n \"trackingLevel_i\" : 100000\n }, {\n \"contextId_s\" : \"product5\",\n \"price_money\" : 5.99,\n \"brandId_s\" : \"brand-daves\",\n \"merchandisingTypeId_s\" : \"merchandisingType-hot-sauces\",\n \"sku_s\" : \"HS-CCPHS-20\",\n \"explicitCategoryIds_ss\" : [ \"category7\", \"category1\" ],\n \"primaryAssetType_s\" : \"IMAGE\",\n \"categoryIds_ss\" : [ \"category7\", \"category3\", \"category1\" ],\n \"currency_currency\" : \"USD\",\n \"primaryAssetContentTitle_s\" : \"Bottle of Cool Cayenne Pepper Hot Sauce\",\n \"primaryAssetContentUrl_s\" : \"https://admin.blcdemo.com/api/asset/content/Cool-Cayenne-Pepper-Hot-Sauce-Bottle.jpg?contextRequest=%7B%22forceCatalogForFetch%22:false,%22tenantId%22:%225DF1363059675161A85F576D%22%7D\",\n \"uri_s\" : \"/hot-sauces/cool_cayenne_pepper_hot_sauce\",\n \"brandDisplayValue_s_en_US\" : \"Dave's\",\n \"merchandisingTypeDisplayValue_s_en_US\" : \"Hot Sauces\",\n \"explicitCategoryNames_ss_en_US\" : [ \"Top Sellers\", \"Hot Sauces\" ],\n \"categoryNames_ss_en_US\" : [ \"Top Sellers\", \"Merchandise\", \"Hot Sauces\" ],\n \"primaryAssetAltText_s_en_US\" : \"Bottle of Cool Cayenne Pepper Hot Sauce\",\n \"description_t_en_US\" : \"This sauce gets its great flavor from aged peppers and cane vinegar. It will enhance the flavor of most any meal.\",\n \"name_s_en_US\" : \"Cool Cayenne Pepper Hot Sauce\",\n \"catalog_s\" : \"3\",\n \"trackingLevel_i\" : 100000\n }, {\n \"contextId_s\" : \"01F9Y6RZM1Y4J00ZWJJKM316CK\",\n \"price_money\" : 2.99,\n \"brandId_s\" : \"brand-bull-snort\",\n \"merchandisingTypeId_s\" : \"merchandisingType-hot-sauces\",\n \"sku_s\" : \"HS-CP-10\",\n \"explicitCategoryIds_ss\" : [ \"category1\" ],\n \"primaryAssetType_s\" : \"IMAGE\",\n \"categoryIds_ss\" : [ \"category3\", \"category1\" ],\n \"currency_currency\" : \"USD\",\n \"primaryAssetContentUrl_s\" : \"https://admin.blcdemo.com/api/asset/content/Bull-Snort-Cowboy-Cayenne-Pepper-Hot-Sauce-Bottle.jpg?contextRequest=%7B%22forceCatalogForFetch%22:false,%22tenantId%22:%225DF1363059675161A85F576D%22%7D\",\n \"uri_s\" : \"/hot-sauces/bull-snort-cowboy-cayenne-pepper-hot-sauce\",\n \"brandDisplayValue_s_en_US\" : \"Bull Snort\",\n \"merchandisingTypeDisplayValue_s_en_US\" : \"Hot Sauces\",\n \"explicitCategoryNames_ss_en_US\" : [ \"Hot Sauces\" ],\n \"categoryNames_ss_en_US\" : [ \"Merchandise\", \"Hot Sauces\" ],\n \"primaryAssetAltText_s_en_US\" : \"Bottle of Cowboy Cayenne Pepper Hot Sauce\",\n \"description_t_en_US\" : \"<p>Been there, roped that. Hotter than a buckin' mare in heat! Sprinkle on meat entrees, seafood and vegetables. Use as additive in barbecue sauce or any food that needs a spicy flavor. Start with a few drops and work up to the desired flavor.</p>\",\n \"name_s_en_US\" : \"Bull Snort Cowboy Cayenne Pepper Hot Sauce\",\n \"catalog_s\" : \"3\",\n \"trackingLevel_i\" : 100000\n }, {\n \"contextId_s\" : \"product1\",\n \"price_money\" : 11.99,\n \"merchandisingTypeId_s\" : \"merchandisingType-hot-sauces\",\n \"sku_s\" : \"HS-GG-20\",\n \"explicitCategoryIds_ss\" : [ \"category7\", \"category1\" ],\n \"primaryAssetType_s\" : \"IMAGE\",\n \"categoryIds_ss\" : [ \"category7\", \"category3\", \"category1\" ],\n \"currency_currency\" : \"USD\",\n \"primaryAssetContentTitle_s\" : \"Bottle of Green Ghost\",\n \"primaryAssetContentUrl_s\" : \"https://admin.blcdemo.com/api/asset/content/Green-Ghost-Bottle.jpg?contextRequest=%7B%22forceCatalogForFetch%22:false,%22tenantId%22:%225DF1363059675161A85F576D%22%7D\",\n \"uri_s\" : \"/hot-sauces/green-ghost\",\n \"searchableAdvancedTags_ss_en_US\" : [ \"On Sale\" ],\n \"discountTagFacets_ss_en_US\" : [ \"On Sale\" ],\n \"merchandisingTypeDisplayValue_s_en_US\" : \"Hot Sauces\",\n \"explicitCategoryNames_ss_en_US\" : [ \"Top Sellers\", \"Hot Sauces\" ],\n \"categoryNames_ss_en_US\" : [ \"Top Sellers\", \"Merchandise\", \"Hot Sauces\" ],\n \"primaryAssetAltText_s_en_US\" : \"Bottle of Green Ghost\",\n \"description_t_en_US\" : \"Made with Naga Bhut Jolokia, the World's Hottest pepper.\",\n \"name_s_en_US\" : \"Green Ghost Test\",\n \"catalog_s\" : \"PD_CATALOG_DEMO37MU1Z\",\n \"trackingLevel_i\" : 100000\n } ],\n \"facet_counts\" : {\n \"facet_queries\" : { },\n \"facet_fields\" : {\n \"attributeTagFacets_ss_en_US\" : {\n \"New\" : 1\n },\n \"discountTagFacets_ss_en_US\" : {\n \"On Sale\" : 1\n },\n \"genericTagFacets_ss_en_US\" : { },\n \"featureTagFacets_ss_en_US\" : { },\n \"brandDisplayValue_s_en_US\" : {\n \"Bull Snort\" : 3,\n \"Blair's\" : 1,\n \"Dave's\" : 1\n },\n \"targetDemographicDisplayValue_s_en_US\" : { },\n \"merchandisingTypeDisplayValue_s_en_US\" : {\n \"Hot Sauces\" : 7\n }\n },\n \"facet_ranges\" : { },\n \"facet_intervals\" : {\n \"price_money\" : {\n \"[0,10]\" : 5,\n \"[10,*]\" : 3\n }\n },\n \"facet_heatmaps\" : { }\n },\n \"spellcheck\" : {\n \"suggestions\" : { },\n \"collations\" : { }\n },\n \"queryUrl\" : \"spellcheck.collateExtendedResults=true&fl=optionLabel_s,optionName_s,optionValue_s,catalog_s,trackingLevel_i,sandboxOwner_s,sandbox_s,searchableAdvancedTags_ss_en_US,attributeTagFacets_ss_en_US,discountTagFacets_ss_en_US,genericTagFacets_ss_en_US,featureTagFacets_ss_en_US,price_money,brandId_s,targetDemographicId_s,merchandisingTypeId_s,brandDisplayValue_s_en_US,targetDemographicDisplayValue_s_en_US,merchandisingTypeDisplayValue_s_en_US,tags_ss_en_US,tags_txt_en_US,vendorRef_s,availableOnline_b,sku_s,explicitCategoryNames_ss_en_US,explicitCategoryIds_ss,primaryCategoryName_s_en_US,categoryNames_ss_en_US,keywords_ss_en_US,primaryAssetType_s,primaryAssetAltText_s_en_US,primaryCategoryId_s,categoryIds_ss,currency_currency,primaryAssetTags_ss,primaryAssetContentTitle_s,primaryAssetContentUrl_s,uri_s,description_t_en_US,name_s_en_US,contextId_s&spellcheck.maxCollations=1&fq=((*:* AND -inventoryCheckRequired_b:true) OR inventoryAvailableForApplicationScopes_ss:PD_demo37mu1z OR inventoryAvailableForTenantScope_s:5DF1363059675161A85F576D)&fq=-catalogOverrides_ss:(3 OR PD_CATALOG_DEMO37MU1Z)&fq=(catalog_s:(3 PD_CATALOG_DEMO37MU1Z) OR (*:* AND -catalog_s:*))&fq=(trackingLevel_i:100000)&fq=tenant_s:5DF1363059675161A85F576D&fq=activeStartDate_dt:[* TO 2022-04-01T13:31:16.816Z]&fq=-activeEndDate_dt:[* TO 2022-04-01T13:31:16.816Z]&spellcheck.maxCollationTries=1&defType=edismax&spellcheck.q=hot&f.phrase_exact.qf=tags_ss_en_US tags_txt_en_US description_t_en_US name_t_en_US^3.0&qf=id&facet.interval=price_money&f.price_money.facet.interval.set=[0,10]&f.price_money.facet.interval.set=[10,*]&wt=json&facet.field=attributeTagFacets_ss_en_US&facet.field=discountTagFacets_ss_en_US&facet.field=genericTagFacets_ss_en_US&facet.field=featureTagFacets_ss_en_US&facet.field=brandDisplayValue_s_en_US&facet.field=targetDemographicDisplayValue_s_en_US&facet.field=merchandisingTypeDisplayValue_s_en_US&_stateVer_=catalog_collection_1:23&start=0&rows=50&version=2&f.phrase.qf=tags_ss_en_US tags_txt_en_US description_t_en_US name_t_en_US^2.0&f.word.qf=searchableAdvancedTags_ss_en_US^3.0 searchableAdvancedTags_txt_en_US searchableAdvancedTags_txt_part_en_US brandDisplayValue_s_en_US^10.0 merchandisingTypeDisplayValue_s_en_US^10.0 tags_ss_en_US^5.0 tags_txt_en_US categoryNames_ss_en_US description_t_en_US description_t_part_en_US description_tta_en_US description_ttas_en_US name_s_en_US^10.0 name_t_en_US^2.0 name_t_part_en_US name_tta_en_US name_ttas_en_US&q=word:(hot)^2.0 || phrase_exact:(\\\"hot\\\")^4.0 || phrase:(\\\"hot\\\"~2)^3.0&spellcheck=on&facet.mincount=1&spellcheck.count=1&facet=true&spellcheck.collate=true\"\n}", "last": true, "totalPages": 1, "totalElements": 7, "sort": { "sorted": false, "unsorted": true, "empty": true }, "first": true, "number": 0, "numberOfElements": 7, "size": 50, "empty": false }