Page 1 of 1

/catalog/search/products search by attributes?

Posted: Fri Oct 31, 2014 2:32 pm
by rhodebump
Looking at the endpoints documentation:
http://www.broadleafcommerce.com/docs/c ... -endpoints

I do not see a way to pass a set of product attributes to the product search api. I would like to pass a set of attributes and values and have my product search constrained by those attribute/values. That said, if the attribute/value are in the solr index, it wouldn't be hard to construct a solr query to filter by the attributes.

Interested in thoughts on this. I just began building my own PIM and considering using broadleaf instead of building my own.

Re: /catalog/search/products search by attributes?

Posted: Wed Nov 05, 2014 7:55 pm
by phillipuniverse
You can index product attributes into Solr by inserting it into the BLC_SEARCH_FIELD table. For instance, if I had a field called 'heatRange' that I put as a product attribute, I make that queryable by Solr by doing the following:

Code: Select all

INSERT INTO BLC_FIELD (FIELD_ID, ENTITY_TYPE, PROPERTY_NAME, ABBREVIATION, SEARCHABLE, FACET_FIELD_TYPE) VALUES (2, 'PRODUCT', 'productAttributes.heatRange', 'heatRange', TRUE, 'i');


The possible values for FACET_FIELD_TYPE are at http://javadocs.broadleafcommerce.com/c ... dType.html.