[opencms-dev] Solr search issues/questions (8.5.0)

Carsten Wilhelm wilhelm at bplusd.de
Wed Dec 5 15:03:49 CET 2012


Dear all,

We're trying to use the new Solr integration in 8.5.0. Unfortunately some things are not documented or not clearly enough. Maybe someone here might help us:

1) If we define <solrfield> in XML structured content, when will these changes be visible? After the next index update?

2) If we remove <solrfields> from XML structured content, they still appear - even after index update or removing the "Index" directory within the WEB-INF/index/..." folder

3) Is there any way to use "rows" and "start" Solr features from within <cms:contentload>?

4) We're using nested XML content definitions, how can we add mappings to these fields with <solrfield>? We're using different contents (news, articles, downloads etc.) and need to store options on them - all content types share the same options, so we decided to move these options to a nested content definition.

Currently we're using something like this:

    <!-- Definition of nested content -->
    <xsd:complexType name="OpenCmsOptionType">
        <xsd:sequence>
            <xsd:element name="Option 1" type="OpenCmsBoolean" />
            <xsd:element name="Option 2" type="OpenCmsBoolean" />
            <xsd:element name="Option 3" type="OpenCmsBoolean" />
        </xsd:sequence>
        <xsd:attribute name="language" type="OpenCmsLocale" use="optional" />
    </xsd:complexType>


    <!-- Definition of a news item -->
    <xsd:complexType name="OpenCmsNewsItemType">
        <xsd:sequence>
            <xsd:element name="Options" type="OpenCmsOptionType"/>
            <xsd:element name="Headline" type="OpenCmsString" />
            <xsd:element name="Date" type="OpenCmsDateTime" />
            <xsd:element name="Copy" type="OpenCmsHtml" />
            <xsd:element name="Link" type="OpenCmsVfsFile" />
        </xsd:sequence>
        <xsd:attribute name="language" type="OpenCmsLocale" use="required" />
    </xsd:complexType>
    <xsd:annotation>
        <xsd:appinfo>
            <mappings>
                <mapping element="Date" mapto="attribute:datereleased" />
            </mappings>
            <searchsettings>
                <searchsetting element="Options" searchcontent="true">
                    <solrfield sourcefield="*_txt" targetfield="options" copyfields="*"/>
                </searchsetting>
                <searchsetting element="Date" searchcontent="true">
                    <solrfield targetfield="date">
                        <mapping type="property">Date</mapping>
                    </solrfield>
                </searchsetting>
            </searchsettings>
        </xsd:appinfo>
    </xsd:annotation>

Kind regards,
Carsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20121205/2be98430/attachment.htm>


More information about the opencms-dev mailing list