{"id":814,"date":"2020-04-18T05:44:18","date_gmt":"2020-04-18T05:44:18","guid":{"rendered":"https:\/\/www.aeologic.com\/blog\/?p=814"},"modified":"2026-05-18T13:12:31","modified_gmt":"2026-05-18T07:42:31","slug":"indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide","status":"publish","type":"post","link":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/","title":{"rendered":"Indexing and Searching Nested Documents in Solr &#8211; Ultimate Solr Guide"},"content":{"rendered":"<p>Hi All, today I will be writing about another important aspect of Solr that addresses the needs of many business applications \u2014 <a href=\"https:\/\/www.aeologic.com\/web-development\/\"><strong data-start=\"266\" data-end=\"291\">Solr Nested Documents<\/strong><\/a>. Suppose we need to index data for an e-commerce company that hosts a variety of products on its website along with associated SKUs. This data must be indexed, updated, and searched efficiently in a way that is meaningful for both end users and merchandisers. A natural question arises: how should this data be represented, and what approach should be followed to manage it effectively while maintaining scalability and search performance?<\/p>\n<h2>Introduction to Nested Documents in Search Engines<\/h2>\n<p data-start=\"286\" data-end=\"761\">Modern search applications rarely deal with simple, flat datasets. Industries such as e-commerce, healthcare, logistics, travel, and digital marketplaces often manage information that exists in hierarchical relationships. A product may have multiple variants, an order may contain several items, or a customer profile may include numerous transactions. Representing such interconnected data efficiently becomes a challenge when using traditional document indexing approaches.<\/p>\n<p data-start=\"763\" data-end=\"1201\">Search engines like Solr and Lucene are optimized for storing and retrieving documents quickly. However, treating every related entity as an independent document can create issues during querying, filtering, faceting, and relevance ranking. For example, an e-commerce product with multiple SKUs stored as separate records may produce duplicate results or inaccurate facets when users search by attributes such as color, size, or material.<\/p>\n<p data-start=\"1203\" data-end=\"1510\">Nested documents solve this problem by allowing multiple child documents to be associated with a parent document within a single indexed block. Rather than indexing each SKU independently, Solr groups all related child entities beneath a parent entity, preserving relationships during indexing and querying.<\/p>\n<p>To address this problem, Solr provides us with a mechanism to associate multiple docs with each other and put them in a relationship. Also, it provides both indexing and searching mechanisms to get data in and out. What we are referring to here is called a &#8220;Nested document structure&#8221;, or more technically, a BLOCK in Solr. Put simply, a block is a set of parent-child relation between multiple documents.<\/p>\n<p>Let&#8217;s understand this in two parts.<\/p>\n<h2>Indexing Nested Documents<\/h2>\n<p>Let&#8217;s assume a nested structure as below:<\/p>\n<p>{<br \/>\n&#8220;id&#8221;:&#8221;100&#8243;,<br \/>\n&#8220;scope_ss&#8221;:&#8221;product&#8221;,<br \/>\n&#8220;category_ss&#8221;:&#8221;OutdoorSofa&#8221;,<br \/>\n&#8220;productType_ss&#8221;:&#8221;sofa&#8221;,<br \/>\n&#8220;<strong>_childDocuments_<\/strong>&#8220;: [<br \/>\n{<br \/>\n&#8220;id&#8221;:&#8221;101&#8243;,<br \/>\n&#8220;scope_ss&#8221;:&#8221;sku&#8221;,<br \/>\n&#8220;Fabric_ss&#8221;:&#8221;Polyester&#8221;,<br \/>\n&#8220;Depth_ss&#8221;:&#8221;Classic&#8221;,<br \/>\n&#8220;Finish_ss&#8221; : &#8220;Fine&#8221;,<br \/>\n&#8220;Color_ss&#8221;:&#8221;Grey&#8221;},<br \/>\n{<br \/>\n&#8220;id&#8221;:&#8221;102&#8243;,<br \/>\n&#8220;scope_ss&#8221;:&#8221;sku&#8221;,<br \/>\n&#8220;Fabric_ss&#8221;:&#8221;nylon&#8221;,<br \/>\n&#8220;Depth_ss&#8221;:&#8221;Petite&#8221;,<br \/>\n&#8220;Finish_ss&#8221; : &#8220;Grey&#8221;,<br \/>\n&#8220;Color_ss&#8221;:&#8221;Green&#8221;},<br \/>\n{<br \/>\n&#8220;id&#8221;:&#8221;103&#8243;,<br \/>\n&#8220;scope_ss&#8221;:&#8221;sku&#8221;,<br \/>\n&#8220;Fabric_ss&#8221;:&#8221;acrylic&#8221;,<br \/>\n&#8220;Depth_ss&#8221;:&#8221;Petite&#8221;,<br \/>\n&#8220;Finish_ss&#8221; : &#8220;Espresso&#8221;,<br \/>\n&#8220;Color_ss&#8221;:&#8221;Green&#8221;},<br \/>\n{<br \/>\n&#8220;id&#8221;:&#8221;104&#8243;,<br \/>\n&#8220;scope_ss&#8221;:&#8221;sku&#8221;,<br \/>\n&#8220;Fabric_ss&#8221;:&#8221;Polyester&#8221;,<br \/>\n&#8220;Depth_ss&#8221;: &#8220;Classic&#8221;,<br \/>\n&#8220;Finish_ss&#8221; : &#8220;Grey&#8221;,<br \/>\n&#8220;Color_ss&#8221;:&#8221;Dove&#8221;},<\/p>\n<p>{&#8220;id&#8221;:&#8221;105&#8243;,<br \/>\n&#8220;scope_ss&#8221;:&#8221;sku&#8221;,<br \/>\n&#8220;Fabric_ss&#8221;:&#8221;nylon&#8221;,<br \/>\n&#8220;Depth_ss&#8221;: &#8220;Classic&#8221;,<br \/>\n&#8220;Finish_ss&#8221; : &#8220;Grey&#8221;,<br \/>\n&#8220;Color_ss&#8221;:&#8221;Blue&#8221;}]<\/p>\n<p>}<\/p>\n<p><strong>_childDocuments_\u00a0<\/strong>tells solr that each object defined within the scope is a child to the doc it belongs to. In essence, we have just created a block of information that has properties for SKU&#8217;s which imparts some meaning to the application scenarios. Now let&#8217;s see how we can index the doc. Utilizing Solr&#8217;s dynamic schema mapping capabilities, we can be certain that all the fields in the document will get indexed and get reflected (Notice <strong>_ss <\/strong>in fields, they are stored as String array). Now, one may ask upon careful observation that why the data type used is array when the field is storing String type information. Answer to this question lies in more subtle understanding of inner working of Solr.<\/p>\n<p>When Solr indexes a nested document, it stores all field values for a field in a set. This effectively means each field has multiple values and hence the type, array of String. If one tries to index data without using _ss or just _s (String type in Solr), solr engine throws an error. Now, assuming we have settled with basics, let&#8217;s continue to index the data.<\/p>\n<p>Fire up UI and index data by navigating to necessary modalities as below:<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-815\" src=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Solr_doc.png\" alt=\"\" width=\"682\" height=\"608\" srcset=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Solr_doc.png 829w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Solr_doc-300x267.png 300w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Solr_doc-768x685.png 768w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Solr_doc-505x450.png 505w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Solr_doc-260x232.png 260w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Solr_doc-90x80.png 90w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Solr_doc-213x190.png 213w\" sizes=\"(max-width: 682px) 100vw, 682px\" \/><\/p>\n<p>Paste the JSON doc in &#8220;Documents(s)&#8221; section and index the document. If all configuration is proper, then, the index upon querying will appear as below:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-826\" src=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/index.png\" alt=\"\" width=\"394\" height=\"875\" srcset=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/index.png 394w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/index-135x300.png 135w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/index-203x450.png 203w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/index-117x260.png 117w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/index-36x80.png 36w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/index-86x190.png 86w\" sizes=\"(max-width: 394px) 100vw, 394px\" \/><\/p>\n<p><strong>Note:<\/strong> Notice how the parent doc (the product information) is referenced at bottom and child docs are piled upon it. This is not by accident but by design.<\/p>\n<h2>Solr 9.x nested document updates<\/h2>\n<p>## Nested Documents in Solr 9.x: What Changed?<\/p>\n<p>Solr 9.x introduced improvements in nested document handling, memory efficiency, and query execution for block joins. Compared to older Solr versions, nested indexing now performs better with large SKU catalogs and deep parent-child hierarchies.<\/p>\n<p>Key enhancements include:<\/p>\n<p>\u2022 Improved block join query execution<br \/>\n\u2022 Better heap utilization during indexing<br \/>\n\u2022 Faster JSON Facet API performance<br \/>\n\u2022 Optimized update handling for nested documents<br \/>\n\u2022 Reduced latency for large product catalogs<\/p>\n<p>Businesses handling millions of SKUs can observe noticeable improvements in search throughput and indexing speed after migrating to Solr 9.x.<\/p>\n<h2>Querying Nested Documents<\/h2>\n<p>Let&#8217;s dive into basics of querying nested docs in Solr.<\/p>\n<p>One of the most needed use-case in context of e-commerce data-set is Faceting. Faceting for nested docs by design is different than traditional docs in Solr.<\/p>\n<ul>\n<li>To understand this, let&#8217;s generate facets for Color_ss and Fabric_ss fields.\n<ul>\n<li><strong>Query Syntax<\/strong>: &amp;json.facet={Fabrics:{type:terms,field:<strong>Fabric_ss<\/strong>,limit:-1},Colors:{type:terms,field:<strong>Color_ss<\/strong>,limit:-1}}&amp;rows=0<\/li>\n<li><strong>Response<\/strong>:<img decoding=\"async\" class=\"alignnone size-full wp-image-828\" src=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/color_fabric_response.png\" alt=\"\" width=\"982\" height=\"581\" srcset=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/color_fabric_response.png 982w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/color_fabric_response-300x177.png 300w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/color_fabric_response-768x454.png 768w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/color_fabric_response-720x426.png 720w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/color_fabric_response-260x154.png 260w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/color_fabric_response-135x80.png 135w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/color_fabric_response-250x148.png 250w\" sizes=\"(max-width: 982px) 100vw, 982px\" \/><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>If one observes carefully, one can see clearly how two buckets for each of the fields is formed. First bucket for Fabrics and second bucket for colors. Its worth mentioning here that the name, &#8220;Fabrics&#8221; and &#8220;Colors&#8221; are custom headers and can be changed at will.<\/p>\n<ul>\n<li>Lets try something else. Let&#8217;s try nested faceting here.\n<ul>\n<li><strong>Query<\/strong>: &amp;json.facet={Fabrics:{type:terms,field:Fabric_ss,limit:-1,facet:{Colors:{type:terms,field:Color_ss,limit:-1}}}}&amp;rows=0<\/li>\n<li><strong>Response<\/strong>:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-830\" src=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet.png\" alt=\"\" width=\"1049\" height=\"659\" srcset=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet.png 1049w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet-300x188.png 300w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet-1024x643.png 1024w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet-768x482.png 768w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet-716x450.png 716w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet-260x163.png 260w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet-127x80.png 127w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet-250x157.png 250w\" sizes=\"(max-width: 1049px) 100vw, 1049px\" \/><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Here, we have a bucket called &#8220;Fabrics&#8221; and nested within it is another bucket called &#8220;Colors&#8221;. In essence, we are presented with more granular information telling the color of each fabric type.<\/p>\n<p>Let&#8217;s try another interesting query, one combining nested faceting with independent buckets.<\/p>\n<ul>\n<li><strong>Query<\/strong>: &amp;json.facet={Depth:{type:terms,field:Depth_ss,limit:-1},Fabrics:{type:terms,field:Fabric_ss,limit:-1,facet:{Colors:{type:terms,field:Color_ss,limit:-1}}}}&amp;rows=0<\/li>\n<li><strong>Response:<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-832\" src=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent.png\" alt=\"\" width=\"1414\" height=\"755\" srcset=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent.png 1414w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent-300x160.png 300w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent-1024x547.png 1024w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent-768x410.png 768w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent-720x384.png 720w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent-1180x630.png 1180w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent-260x139.png 260w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent-150x80.png 150w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/nested_facet_independent-250x133.png 250w\" sizes=\"(max-width: 1414px) 100vw, 1414px\" \/><\/li>\n<\/ul>\n<p>Here, as one observes carefully, one bucket stands for independent Depth and other stands for nested facet for Fabric with Color. This enables businesses using Solr to present product information at a granular level for their customers.<\/p>\n<p>Some other useful queries include:<\/p>\n<ul>\n<li>To view all products and SKU information:\n<ul>\n<li><strong>Query:<\/strong> q=*:*&amp;rows=10<\/li>\n<li><strong>Response:<\/strong>\n<ul>\n<li><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-833\" src=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/all.png\" alt=\"\" width=\"398\" height=\"893\" srcset=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/all.png 398w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/all-134x300.png 134w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/all-201x450.png 201w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/all-116x260.png 116w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/all-36x80.png 36w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/all-85x190.png 85w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>To fetch specific products and its associated SKUs:\n<ul>\n<li><strong>Query<\/strong>: q={!child%20of=&#8221;scope_ss:product&#8221;}id:100&amp;wt=json<\/li>\n<li><strong>Response:<\/strong><\/li>\n<li><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-834\" src=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/specific_product.png\" alt=\"\" width=\"442\" height=\"796\" srcset=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/specific_product.png 442w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/specific_product-167x300.png 167w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/specific_product-250x450.png 250w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/specific_product-144x260.png 144w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/specific_product-44x80.png 44w, https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/specific_product-106x190.png 106w\" sizes=\"(max-width: 442px) 100vw, 442px\" \/><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>{!child%20of=&#8221;scope_ss:product&#8221;}<\/strong> &#8211; This filter fetches information for all parent products by using the unique field-value pair used to identify a parent doc in index.<\/p>\n<p><strong>id:100 &#8211; <\/strong>This filter fetches &#8220;some&#8221; parents based on a specific field-value pair for a parent doc.<\/p>\n<h2>Block Join Query Examples<\/h2>\n<p>## Advanced Querying Using Block Join Queries<\/p>\n<p>Solr provides parent and child query parsers for traversing nested structures.<\/p>\n<p>### Fetch parent products based on child SKU attributes<\/p>\n<p>Example:<br \/>\nQuery:<\/p>\n<p>q={!parent which=&#8221;scope_ss:product&#8221;}Color_ss:Green<\/p>\n<p>Result:<br \/>\nReturns parent products containing SKUs where Color = Green.<\/p>\n<p>&#8212;<\/p>\n<p>### Fetch child SKUs belonging to specific parent products<\/p>\n<p>Query:<\/p>\n<p>q={!child of=&#8221;scope_ss:product&#8221;}category_ss:OutdoorSofa<\/p>\n<p>Returns:<\/p>\n<p>All SKU documents belonging to Outdoor Sofa products.<\/p>\n<p>&#8212;<\/p>\n<p>### Combined Block Join Query<\/p>\n<p>Query:<\/p>\n<p>q={!parent which=&#8221;scope_ss:product&#8221;}(Color_ss:Green AND Fabric_ss:nylon)<\/p>\n<p>Use Case:<\/p>\n<p>Show products having Green-colored nylon variants.<\/p>\n<h2>Performance Benchmark Section<\/h2>\n<p>## Performance Considerations for Nested Documents<\/p>\n<p>Nested documents improve data modeling but can impact indexing speed.<\/p>\n<p>Sample benchmark (illustrative):<\/p>\n<p>Dataset:<br \/>\n100K Products<br \/>\n500K SKU documents<\/p>\n<p>Environment:<br \/>\n8 GB Heap<br \/>\nSolr 9.x<br \/>\nSSD Storage<\/p>\n<p>Observed metrics:<\/p>\n<p>Flat documents indexing:<br \/>\n\u2248 18K docs\/sec<\/p>\n<p>Nested documents indexing:<br \/>\n\u2248 10K docs\/sec<\/p>\n<p>Block Join query latency:<br \/>\n40\u2013120 ms<\/p>\n<p>JSON Faceting:<br \/>\n50\u2013200 ms<\/p>\n<p>Update operations:<br \/>\nHigher cost due to complete block reindexing<\/p>\n<p>Takeaway:<\/p>\n<p>Nested structures improve query flexibility but increase update overhead. Designing block sizes carefully is important for e-commerce deployments.<\/p>\n<h2>Updating a nested document in Solr<\/h2>\n<p>Updating a nested document in Solr involves is a very tricky business. One has to update a complete BLOCK if a single SKU has to be updated or a new SKU has to be added. (<strong>THIS IS THE ONLY LIMITATION OF SOLR<\/strong>). This essentially happens because of underlying Lucene handlers. Exact explanation for this, though present, is beyond the scope of this post.<\/p>\n<h1>Deleting a SKU\/child document<\/h1>\n<p>The solr document is a little ambiguous about it though based on a simple POC, its clear that one can remove a child doc from solr by using a simple delete by ID API. One can invoke update handler for core\/collection as below:<\/p>\n<p><strong>Query:<\/strong> update?stream.body=&lt;delete&gt;&lt;query&gt;<strong>id:101&lt;<\/strong>\/query&gt;&lt;\/delete&gt;&amp;commit=true<\/p>\n<p><strong>Response:\u00a0<\/strong> This removes the child document with id:101 from index<\/p>\n<p>So, that&#8217;s it for today. Will be back with another interesting post on Solr.<\/p>\n<h2>Cross-link to Circuit Breakers Solr post<\/h2>\n<p>## Final Thoughts<\/p>\n<p>Nested documents provide a powerful mechanism for representing product-SKU relationships in Solr. While they improve search relevance and faceting capabilities, update operations remain costly because complete blocks must be rewritten.<\/p>\n<p>When deploying nested structures at enterprise scale, memory tuning and cluster protection become equally important.<\/p>\n<p>You may also explore:<br \/>\n&#8220;Understanding Circuit Breakers in Solr for High Traffic Search Systems&#8221;<\/p>\n<p>This complements nested indexing strategies by preventing node failures during expensive queries and indexing spikes.<\/p>\n<h2 data-section-id=\"1079bb9\" data-start=\"96\" data-end=\"110\">Conclusion<\/h2>\n<p data-start=\"112\" data-end=\"576\">Nested documents in Solr provide a powerful way to model complex parent-child relationships, making them highly suitable for e-commerce platforms, inventory systems, product catalogs, and applications that require granular search experiences. Features such as block indexing, JSON faceting, and block join queries enable businesses to deliver richer search capabilities while maintaining meaningful relationships between products and associated entities like SKUs.<\/p>\n<p data-start=\"578\" data-end=\"955\">At <a href=\"https:\/\/aeologic.com\/contact-us\/\"><strong data-start=\"581\" data-end=\"606\">AeoLogic Technologies<\/strong><\/a>, we work on building scalable search, AI, and enterprise solutions that help organizations manage complex data structures efficiently. Leveraging technologies such as Solr for intelligent search and indexing allows businesses to improve product discoverability, enhance operational efficiency, and create faster, more personalized user experiences.<\/p>\n<h2 data-section-id=\"yn99c3\" data-start=\"108\" data-end=\"116\">FAQs<\/h2>\n<h3 data-start=\"118\" data-end=\"168\">Q1. How do you index nested documents in Solr?<\/h3>\n<p data-start=\"169\" data-end=\"610\">Nested documents in Solr are indexed using the <code data-start=\"216\" data-end=\"234\">_childDocuments_<\/code> field, which allows multiple child documents to be associated with a parent document in a single block. Parent-child relationships are stored together during indexing, enabling efficient querying and faceting across related records. For example, an e-commerce product can act as a parent document while individual SKUs, variants, or attributes are indexed as child documents.<\/p>\n<h3 data-start=\"617\" data-end=\"659\">Q2. What is block join in Apache Solr?<\/h3>\n<p data-start=\"660\" data-end=\"1091\">Block join in Apache Solr is a querying mechanism used to retrieve parent documents based on child document conditions or fetch child documents from matching parent records. It enables searches across nested document structures using special query parsers such as <code data-start=\"924\" data-end=\"935\">{!parent}<\/code> and <code data-start=\"940\" data-end=\"950\">{!child}<\/code>. Block joins are commonly used in product catalogs where users search for products using SKU-level attributes like size, color, or material.<\/p>\n<h3 data-start=\"1098\" data-end=\"1150\">Q3. How does Solr handle parent-child documents?<\/h3>\n<p data-start=\"1151\" data-end=\"1539\">Solr stores parent and child documents as a single indexed block using Lucene\u2019s nested document architecture. The parent document typically contains high-level information, while child documents store related details such as product variants or metadata. During updates, Solr generally reindexes the entire block because parent-child records are internally linked within the same segment.<\/p>\n<h3 data-start=\"1546\" data-end=\"1609\">Q4. Is Solr better than Elasticsearch for nested documents?<\/h3>\n<p data-start=\"1610\" data-end=\"2063\">Solr and Elasticsearch both support nested documents, but their approaches differ. Solr provides strong support for block joins, JSON faceting, and complex parent-child relationships, making it effective for large catalog-based applications. Elasticsearch offers nested and parent-child mappings with flexible distributed search capabilities. The better option depends on workload requirements, update frequency, indexing patterns, and query complexity.<\/p>\n<h3 data-start=\"2070\" data-end=\"2116\">Q5. How to query nested documents in Solr?<\/h3>\n<p data-start=\"2117\" data-end=\"2221\">Nested documents in Solr can be queried using block join parsers and standard query syntax. For example:<\/p>\n<p data-start=\"2223\" data-end=\"2262\">Parent query based on child attributes:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\" dir=\"ltr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code>q={!parent which=\"scope_ss:product\"}Color_ss:Green<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p data-start=\"2333\" data-end=\"2367\">Child query from parent documents:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\" dir=\"ltr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code>q={!child of=\"scope_ss:product\"}id:100<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p data-start=\"2426\" data-end=\"2557\">These queries help retrieve products, SKUs, and related nested information efficiently while preserving parent-child relationships.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All, today I will be writing about another important aspect of Solr that addresses the needs of many business applications \u2014 Solr Nested Documents. Suppose we need to index data for an e-commerce company that hosts a variety of products on its website along with associated SKUs. This data must be indexed, updated, and searched efficiently in a way that is meaningful for both end users and merchandisers. A natural question arises: how should this data be represented, and what approach should be followed to manage it effectively while maintaining scalability and search performance? Introduction to Nested Documents in Search Engines Modern search applications rarely deal with simple, flat datasets. Industries such as e-commerce, healthcare, logistics, travel, and digital marketplaces often manage information that exists in hierarchical relationships. A product may have multiple variants, an order may contain several items, or a customer profile may include numerous transactions. Representing such interconnected data efficiently becomes a challenge when using traditional document indexing approaches. Search engines like Solr and Lucene are optimized for storing and retrieving documents quickly. However, treating every related entity as an independent document can create issues during querying, filtering, faceting, and relevance ranking. For example, an e-commerce product with multiple SKUs stored as separate records may produce duplicate results or inaccurate facets when users search by attributes such as color, size, or material. Nested documents solve this problem by allowing multiple child documents to be associated with a parent document within a single indexed block. Rather than indexing each SKU independently, Solr groups all related child entities beneath a parent entity, preserving relationships during indexing and querying. To address this problem, Solr provides us with a mechanism to associate multiple docs with each other and put them in a relationship. Also, it provides both indexing and searching mechanisms to get data in and out. What we are referring to here is called a &#8220;Nested document structure&#8221;, or more technically, a BLOCK in Solr. Put simply, a block is a set of parent-child relation between multiple documents. Let&#8217;s understand this in two parts. Indexing Nested Documents Let&#8217;s assume a nested structure as below: { &#8220;id&#8221;:&#8221;100&#8243;, &#8220;scope_ss&#8221;:&#8221;product&#8221;, &#8220;category_ss&#8221;:&#8221;OutdoorSofa&#8221;, &#8220;productType_ss&#8221;:&#8221;sofa&#8221;, &#8220;_childDocuments_&#8220;: [ { &#8220;id&#8221;:&#8221;101&#8243;, &#8220;scope_ss&#8221;:&#8221;sku&#8221;, &#8220;Fabric_ss&#8221;:&#8221;Polyester&#8221;, &#8220;Depth_ss&#8221;:&#8221;Classic&#8221;, &#8220;Finish_ss&#8221; : &#8220;Fine&#8221;, &#8220;Color_ss&#8221;:&#8221;Grey&#8221;}, { &#8220;id&#8221;:&#8221;102&#8243;, &#8220;scope_ss&#8221;:&#8221;sku&#8221;, &#8220;Fabric_ss&#8221;:&#8221;nylon&#8221;, &#8220;Depth_ss&#8221;:&#8221;Petite&#8221;, &#8220;Finish_ss&#8221; : &#8220;Grey&#8221;, &#8220;Color_ss&#8221;:&#8221;Green&#8221;}, { &#8220;id&#8221;:&#8221;103&#8243;, &#8220;scope_ss&#8221;:&#8221;sku&#8221;, &#8220;Fabric_ss&#8221;:&#8221;acrylic&#8221;, &#8220;Depth_ss&#8221;:&#8221;Petite&#8221;, &#8220;Finish_ss&#8221; : &#8220;Espresso&#8221;, &#8220;Color_ss&#8221;:&#8221;Green&#8221;}, { &#8220;id&#8221;:&#8221;104&#8243;, &#8220;scope_ss&#8221;:&#8221;sku&#8221;, &#8220;Fabric_ss&#8221;:&#8221;Polyester&#8221;, &#8220;Depth_ss&#8221;: &#8220;Classic&#8221;, &#8220;Finish_ss&#8221; : &#8220;Grey&#8221;, &#8220;Color_ss&#8221;:&#8221;Dove&#8221;}, {&#8220;id&#8221;:&#8221;105&#8243;, &#8220;scope_ss&#8221;:&#8221;sku&#8221;, &#8220;Fabric_ss&#8221;:&#8221;nylon&#8221;, &#8220;Depth_ss&#8221;: &#8220;Classic&#8221;, &#8220;Finish_ss&#8221; : &#8220;Grey&#8221;, &#8220;Color_ss&#8221;:&#8221;Blue&#8221;}] } _childDocuments_\u00a0tells solr that each object defined within the scope is a child to the doc it belongs to. In essence, we have just created a block of information that has properties for SKU&#8217;s which imparts some meaning to the application scenarios. Now let&#8217;s see how we can index the doc. Utilizing Solr&#8217;s dynamic schema mapping capabilities, we can be certain that all the fields in the document will get indexed and get reflected (Notice _ss in fields, they are stored as String array). Now, one may ask upon careful observation that why the data type used is array when the field is storing String type information. Answer to this question lies in more subtle understanding of inner working of Solr. When Solr indexes a nested document, it stores all field values for a field in a set. This effectively means each field has multiple values and hence the type, array of String. If one tries to index data without using _ss or just _s (String type in Solr), solr engine throws an error. Now, assuming we have settled with basics, let&#8217;s continue to index the data. Fire up UI and index data by navigating to necessary modalities as below: Paste the JSON doc in &#8220;Documents(s)&#8221; section and index the document. If all configuration is proper, then, the index upon querying will appear as below: Note: Notice how the parent doc (the product information) is referenced at bottom and child docs are piled upon it. This is not by accident but by design. Solr 9.x nested document updates ## Nested Documents in Solr 9.x: What Changed? Solr 9.x introduced improvements in nested document handling, memory efficiency, and query execution for block joins. Compared to older Solr versions, nested indexing now performs better with large SKU catalogs and deep parent-child hierarchies. Key enhancements include: \u2022 Improved block join query execution \u2022 Better heap utilization during indexing \u2022 Faster JSON Facet API performance \u2022 Optimized update handling for nested documents \u2022 Reduced latency for large product catalogs Businesses handling millions of SKUs can observe noticeable improvements in search throughput and indexing speed after migrating to Solr 9.x. Querying Nested Documents Let&#8217;s dive into basics of querying nested docs in Solr. One of the most needed use-case in context of e-commerce data-set is Faceting. Faceting for nested docs by design is different than traditional docs in Solr. To understand this, let&#8217;s generate facets for Color_ss and Fabric_ss fields. Query Syntax: &amp;json.facet={Fabrics:{type:terms,field:Fabric_ss,limit:-1},Colors:{type:terms,field:Color_ss,limit:-1}}&amp;rows=0 Response: If one observes carefully, one can see clearly how two buckets for each of the fields is formed. First bucket for Fabrics and second bucket for colors. Its worth mentioning here that the name, &#8220;Fabrics&#8221; and &#8220;Colors&#8221; are custom headers and can be changed at will. Lets try something else. Let&#8217;s try nested faceting here. Query: &amp;json.facet={Fabrics:{type:terms,field:Fabric_ss,limit:-1,facet:{Colors:{type:terms,field:Color_ss,limit:-1}}}}&amp;rows=0 Response: Here, we have a bucket called &#8220;Fabrics&#8221; and nested within it is another bucket called &#8220;Colors&#8221;. In essence, we are presented with more granular information telling the color of each fabric type. Let&#8217;s try another interesting query, one combining nested faceting with independent buckets. Query: &amp;json.facet={Depth:{type:terms,field:Depth_ss,limit:-1},Fabrics:{type:terms,field:Fabric_ss,limit:-1,facet:{Colors:{type:terms,field:Color_ss,limit:-1}}}}&amp;rows=0 Response:\u00a0 Here, as one observes carefully, one bucket stands for independent Depth and other stands for nested facet for Fabric with Color. This enables businesses using Solr to present product information at a granular level for their customers. Some other useful queries include: To view all products and SKU information: Query: q=*:*&amp;rows=10 Response: To fetch specific products and its associated SKUs: Query: q={!child%20of=&#8221;scope_ss:product&#8221;}id:100&amp;wt=json Response: {!child%20of=&#8221;scope_ss:product&#8221;} &#8211; This filter fetches information for all parent products by using the unique [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":839,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[105,107,91,106],"class_list":["post-814","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-solr","tag-nested-doc-solr","tag-nested-structure-solr","tag-solr-index","tag-solr-nested-documents"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Indexing and Searching Nested Documents in Solr - Ultimate Solr Guide<\/title>\n<meta name=\"description\" content=\"Learn Solr Nested Documents, block joins, faceting, indexing, updates, and parent-child queries for scalable search.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Indexing and Searching Nested Documents in Solr - Ultimate Solr Guide\" \/>\n<meta property=\"og:description\" content=\"Learn Solr Nested Documents, block joins, faceting, indexing, updates, and parent-child queries for scalable search.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Aeologic Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AeoLogicTech\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-18T05:44:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-18T07:42:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1080\" \/>\n\t<meta property=\"og:image:height\" content=\"622\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Manoj Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@aeologictech\" \/>\n<meta name=\"twitter:site\" content=\"@aeologictech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manoj Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/\"},\"author\":{\"name\":\"Manoj Kumar\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/13549984ba8e5f441cc733ed20d7daa4\"},\"headline\":\"Indexing and Searching Nested Documents in Solr &#8211; Ultimate Solr Guide\",\"datePublished\":\"2020-04-18T05:44:18+00:00\",\"dateModified\":\"2026-05-18T07:42:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/\"},\"wordCount\":2026,\"publisher\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png\",\"keywords\":[\"Nested doc solr\",\"Nested structure solr\",\"solr index\",\"Solr nested documents\"],\"articleSection\":[\"Solr\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/\",\"url\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/\",\"name\":\"Indexing and Searching Nested Documents in Solr - Ultimate Solr Guide\",\"isPartOf\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png\",\"datePublished\":\"2020-04-18T05:44:18+00:00\",\"dateModified\":\"2026-05-18T07:42:31+00:00\",\"description\":\"Learn Solr Nested Documents, block joins, faceting, indexing, updates, and parent-child queries for scalable search.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#primaryimage\",\"url\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png\",\"contentUrl\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png\",\"width\":1080,\"height\":622},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.aeologic.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Indexing and Searching Nested Documents in Solr &#8211; Ultimate Solr Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#website\",\"url\":\"https:\/\/www.aeologic.com\/blog\/\",\"name\":\"Aeologic Blog\",\"description\":\"Aeologic\",\"publisher\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.aeologic.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#organization\",\"name\":\"AeoLogic Technologies\",\"url\":\"https:\/\/www.aeologic.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2022\/05\/new-logo-aeo.jpg\",\"contentUrl\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2022\/05\/new-logo-aeo.jpg\",\"width\":385,\"height\":162,\"caption\":\"AeoLogic Technologies\"},\"image\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/AeoLogicTech\/\",\"https:\/\/x.com\/aeologictech\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/13549984ba8e5f441cc733ed20d7daa4\",\"name\":\"Manoj Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/24ce77602da5eb5715d74a95733f6c7548e2af73f5a493f9bc0bf55f611d025e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/24ce77602da5eb5715d74a95733f6c7548e2af73f5a493f9bc0bf55f611d025e?s=96&d=mm&r=g\",\"caption\":\"Manoj Kumar\"},\"description\":\"Manoj Kumar is a seasoned Digital Marketing Manager and passionate Tech Blogger with deep expertise in SEO, AI trends, and emerging digital technologies. He writes about innovative solutions that drive growth and transformation across industry. Featured on - YOURSTORY | TECHSLING | ELEARNINGINDUSTRY | DATASCIENCECENTRAL | TIMESOFINDIA | MEDIUM | DATAFLOQ\",\"sameAs\":[\"https:\/\/www.aeologic.com\/\",\"https:\/\/www.linkedin.com\/in\/manoj-kumar-rajput\/\"],\"url\":\"https:\/\/www.aeologic.com\/blog\/author\/manoj\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Indexing and Searching Nested Documents in Solr - Ultimate Solr Guide","description":"Learn Solr Nested Documents, block joins, faceting, indexing, updates, and parent-child queries for scalable search.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/","og_locale":"en_US","og_type":"article","og_title":"Indexing and Searching Nested Documents in Solr - Ultimate Solr Guide","og_description":"Learn Solr Nested Documents, block joins, faceting, indexing, updates, and parent-child queries for scalable search.","og_url":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/","og_site_name":"Aeologic Blog","article_publisher":"https:\/\/www.facebook.com\/AeoLogicTech\/","article_published_time":"2020-04-18T05:44:18+00:00","article_modified_time":"2026-05-18T07:42:31+00:00","og_image":[{"width":1080,"height":622,"url":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png","type":"image\/png"}],"author":"Manoj Kumar","twitter_card":"summary_large_image","twitter_creator":"@aeologictech","twitter_site":"@aeologictech","twitter_misc":{"Written by":"Manoj Kumar","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#article","isPartOf":{"@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/"},"author":{"name":"Manoj Kumar","@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/13549984ba8e5f441cc733ed20d7daa4"},"headline":"Indexing and Searching Nested Documents in Solr &#8211; Ultimate Solr Guide","datePublished":"2020-04-18T05:44:18+00:00","dateModified":"2026-05-18T07:42:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/"},"wordCount":2026,"publisher":{"@id":"https:\/\/www.aeologic.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png","keywords":["Nested doc solr","Nested structure solr","solr index","Solr nested documents"],"articleSection":["Solr"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/","url":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/","name":"Indexing and Searching Nested Documents in Solr - Ultimate Solr Guide","isPartOf":{"@id":"https:\/\/www.aeologic.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png","datePublished":"2020-04-18T05:44:18+00:00","dateModified":"2026-05-18T07:42:31+00:00","description":"Learn Solr Nested Documents, block joins, faceting, indexing, updates, and parent-child queries for scalable search.","breadcrumb":{"@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#primaryimage","url":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png","contentUrl":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2020\/04\/Indexing-and-Searching-Nested-Documents-in-Solr.png","width":1080,"height":622},{"@type":"BreadcrumbList","@id":"https:\/\/www.aeologic.com\/blog\/indexing-and-searching-nested-documents-in-solr-ultimate-solr-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.aeologic.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Indexing and Searching Nested Documents in Solr &#8211; Ultimate Solr Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.aeologic.com\/blog\/#website","url":"https:\/\/www.aeologic.com\/blog\/","name":"Aeologic Blog","description":"Aeologic","publisher":{"@id":"https:\/\/www.aeologic.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.aeologic.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.aeologic.com\/blog\/#organization","name":"AeoLogic Technologies","url":"https:\/\/www.aeologic.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2022\/05\/new-logo-aeo.jpg","contentUrl":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2022\/05\/new-logo-aeo.jpg","width":385,"height":162,"caption":"AeoLogic Technologies"},"image":{"@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/AeoLogicTech\/","https:\/\/x.com\/aeologictech"]},{"@type":"Person","@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/13549984ba8e5f441cc733ed20d7daa4","name":"Manoj Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/24ce77602da5eb5715d74a95733f6c7548e2af73f5a493f9bc0bf55f611d025e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/24ce77602da5eb5715d74a95733f6c7548e2af73f5a493f9bc0bf55f611d025e?s=96&d=mm&r=g","caption":"Manoj Kumar"},"description":"Manoj Kumar is a seasoned Digital Marketing Manager and passionate Tech Blogger with deep expertise in SEO, AI trends, and emerging digital technologies. He writes about innovative solutions that drive growth and transformation across industry. Featured on - YOURSTORY | TECHSLING | ELEARNINGINDUSTRY | DATASCIENCECENTRAL | TIMESOFINDIA | MEDIUM | DATAFLOQ","sameAs":["https:\/\/www.aeologic.com\/","https:\/\/www.linkedin.com\/in\/manoj-kumar-rajput\/"],"url":"https:\/\/www.aeologic.com\/blog\/author\/manoj\/"}]}},"_links":{"self":[{"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/posts\/814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/comments?post=814"}],"version-history":[{"count":2,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/posts\/814\/revisions"}],"predecessor-version":[{"id":16389,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/posts\/814\/revisions\/16389"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/media\/839"}],"wp:attachment":[{"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/media?parent=814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/categories?post=814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/tags?post=814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}