OpenCms - configuring Solr search to extract nested fields

There is a Foo schema with one nested field

 <?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
   <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd" />
   <xsd:include schemaLocation="opencms://system/modules/com.foo.bar/schemas/barList.xsd" />
   <xsd:element name="Foos" type="OpenCmsFoos" />
   <xsd:complexType name="OpenCmsFoos">
      <xsd:sequence>
         <xsd:element name="Foo" type="OpenCmsFoo" minOccurs="0" maxOccurs="unbounded" />
      </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="OpenCmsFoo">
      <xsd:sequence>
         <xsd:element type="OpenCmsBarList" name="bars"  minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attribute name="language" type="OpenCmsLocale" use="required" />
   </xsd:complexType>
   <xsd:annotation>
      <xsd:appinfo>
         <validationrules />
         <relations />
         <searchsettings containerPageOnly="false">
            <searchsetting element="bars" searchcontent="true">
               <solrfield targetfield="bars" sourcefield="*_s" />
            </searchsetting>
         </searchsettings>
      </xsd:appinfo>
   </xsd:annotation>
</xsd:schema>

      

BarList schema is defined as

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
   <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd" />
   <xsd:element name="BarLists" type="OpenCmsBarLists" />
   <xsd:complexType name="OpenCmsBarLists">
      <xsd:sequence>
         <xsd:element name="BarList" type="OpenCmsBarList" minOccurs="0" maxOccurs="unbounded" />
      </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="OpenCmsBarList">
      <xsd:sequence>
         <xsd:element name="barName" type="OpenCmsString" />
         <xsd:element name="barCategory" type="OpenCmsString"/>
         <xsd:element name="barDescription" type="OpenCmsString"/>
      </xsd:sequence>
      <xsd:attribute name="language" type="OpenCmsLocale" use="optional" />
   </xsd:complexType>
   <xsd:annotation>
      <xsd:appinfo>
         <validationrules />
         <relations />
         <searchsettings containerPageOnly="false">
            <searchsetting element="barList" searchcontent="true">
               <solrfield targetfield="barList" sourcefield="*_s" />
            </searchsetting>
         </searchsettings>
      </xsd:appinfo>
   </xsd:annotation>
</xsd:schema>

      

and when i make a request with an id for resource Foo like

http://<ip>/opencms/handleSolrSelect?fl=*_en_s&fq=id:(<id>)&omitHeader=true

      

BarList is not returned. If I add a textbox of type OpenCmsString / OpenCmsHtml it will be returned. I am using opencms for the first time. Any help is appreciated. Thanks in advance.

0
solr opencms


source to share


No one has answered this question yet

See similar questions:

3
Mapping OpenCMS Structured Content XML Field to SOLR Field

or similar:

190
Choosing a Standalone Full Text Search Server: Sphinx or SOLR?
101
How do I request SOLR for empty fields?
42
Getting specific fields in a Solr query?
36
solr and multi-field query
17
Solr: Get field names from solr index?
3
Mapping OpenCMS Structured Content XML Field to SOLR Field
0
Search for solr field in nested table fields OK, but default search is not displayed
0
Nested boost for a field in solr Search
0
How to get nextCursorMark for solr search with opencms
0
Solr search on OpenCMS



All Articles
Loading...
X
Show
Funny
Dev
Pics