=========================================================================
Archive storage: part 1. Storing & retrieving (attribute) content in Solr
=========================================================================

Introduction
============

As part of the archive master user story, which ultimately
will provide alternate storge of content that might even be removed
from the eZ Publish database, this spec deals with storage of
attribute content in Solr

Solution overview
=================

A new configuration option is introduced:

[IndexOptions]
# Configure attribute storage in the Solr backend
# Warning: this may inflate the index size on large installations
# EnableSolrAttributeStorage=true | false
EnableSolrAttributeStorage=false

If this is set to true, attribute content will be serialized into a JSON master structure

For Solr, the backend schema field to use is "binary", which accepts base64 encoded arbitrary content

So for storage, the entire JSON string is encoded accordingly and sent along the other index fields

The search function is further adapted with new parameters to control the fields returned and deserialize functions

Implementation
==============

The implementation relies on a few new classes:

class ezfSolrStorage
{


    /**
     * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
     * @return array for further processing
     */

    public static function getAttributeData (eZContentObjectAttribute $contentObjectAttribute)
     /**
     *
     * @param array $attributeData
     * @return mixed
     */
    public static function serializeData ( $attributeData )

    /**
     *
     * @param string $storageString
     * @return mixed
     */
    public static function unserializeData ( $storageString )


    /**
     *
     * @param string $fieldNameBase
     * @return string Solr field name
     */
    public static function getSolrStorageFieldName( $fieldNameBase )
}

The base Solr Storage class calls datatype specific handlers (if these exist) in order to construct a
data structure with the following items:

Metadata:

- storage format version
- storage format method
- datatype identifier
- attribute identifier
- has content?
- has rendered content

Content:

- content
- rendered content (optional)



The data structure is basically a nested (hash) array which is then converted to JSON + base64 encoded string for storage and subsequent display

