[opencms-dev] SOLR Multi-field Settings

Rüdiger Kurz r.kurz at alkacon.com
Tue Nov 13 23:17:11 CET 2012


Hi,

this is currently not possible out of the box, but it is already 
implemented in the current development branch and therefore it will be 
part of a future release. For now you can implement the interface 
org.opencms.search.fields.I_CmsSearchFieldMapping and than configure it 
inside the XSD schema of your resource type by adding something like:

<solrfield targetfield="Author">
<mapping type="dynamic" class="org.opencms.yourClass">special</mapping>
</solrfield>

have a look at org.opencms.search.solr.CmsDynamicDummyField

good luck!

regards
Rüdiger

Am 13.11.2012 16:57, schrieb John James Valentine:
> Does anyone have an example on how to use a multifield with solr and the
> new search settings in an XML Content XSD file on OpenCms 8.5?
>
> An example use case would be an author for a news story, there may be
> multiple authors and we would want solr to index all the
>
> authors for that XML content.
>
> Here is the search settings from the XSD:
>
> <searchsettings>
>
> <searchsetting element="Author" searchcontent="true">
>
> <solrfield targetfield="Author" sourcefield=”*_txt” copyfields=”*” />
>
> </searchsetting>
>
> </searchsettings>
>
> The solr field Author_en_txt has been indexed:
>
> <arr name="Author_en_txt">
>
> <str>My Indexed Author</str>
>
> </arr>
>
> We would expect :
>
> <arr name="Author_en_txt">
>
> <str>My Indexed Author</str>
>
> <str>Another Indexed Author</str>
>
> </arr>
>
> Thanks so much,
> John Valentine


-- 
Kind Regards,
Rüdiger.

-------------------

Rüdiger Kurz

Alkacon Software GmbH  - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org



More information about the opencms-dev mailing list