Hi Mike,

Since the solr catalogue persists the CAS namespace protection for core
metadata values, perhaps the problem you are seeing might be caused by this.

A way for you to test it, would be to, if possible, use the CAS. namespace
for your core metadata values (i.e ProductId, should be CAS.ProductId, etc).

Question to OODT dev guys - does the curator support this?

Cheers,
Tom

------

PS: Here listed are snippets from three files with important lines
highlighted in red, to point out this issue for discussion.

- filemgr/catalog/solr/Parameters.java
- filmegr/catalog/solr/SolrCatalog.java
- filemgr/catalog/solr/DefaultProductSerializer.java

Starting with the definition of Parameters, in
filemgr/catalog/solr/Parameters.java

public class Parameters {
        // the Solr unique identifier field
        public final static String ID = "id";

        public final static String NS = "CAS.";

        public final static String PRODUCT_ID = NS+"ProductId";
        public final static String PRODUCT_NAME = NS+"ProductName";
        public final static String PRODUCT_STRUCTURE =
NS+"ProductStructure";
        public final static String PRODUCT_TRANSFER_STATUS =
NS+"ProductTransferStatus";
        public final static String PRODUCT_RECEIVED_TIME =
NS+"ProductReceivedTime";
        public final static String PRODUCT_TYPE_NAME = NS+"ProductTypeName";
        public final static String PRODUCT_TYPE_ID = NS+"ProductTypeId";

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

Here is the addMedata method in filmegr/catalog/solr/SolrCatalog.java

        @Override
        public void addMetadata(Metadata metadata, Product product) throws
CatalogException {

                LOG.info("Adding metadata for
product:"+product.getProductName());

          // serialize metadadta to Solr document(s)
          // replace=false i.e. add metadata to existing values
          List<String> docs =
productSerializer.serialize(product.getProductId(),
metadata, false);

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

Looking at the appropriate method signature in
filemgr/catalog/solr/DefaultProductSerializer.java

        /**
         * {@inheritDoc}
         */
        public List<String> serialize(String productId, Metadata metadata,
boolean replace) {

                Map<String, List<String>> fields = new HashMap<String,
List<String>>();

                for (String key : metadata.getKeys()) {
                        if (! (key.startsWith(Parameters.NS)
 // skip metadata keys starting with reserved namespace
                                     ||
Parameters.PRODUCT_TYPE_NAME.indexOf(key)>=0 // skip 'ProductType' as
already stored as 'CAS.ProductTypeName'
                                     ||
Parameters.PRODUCT_STRUCTURE.indexOf(key)>=0)) { // skip 'ProductType' as
already stored as 'CAS.ProductStructure'
                                for (String value :
metadata.getAllMetadata(key)) {
                                        this.addKeyValueToMap(fields, key,
value);
                                }
                        }
                }

                return this.generateUpdateDocuments(productId, fields,
replace);

        }

Reply via email to