Skip to Content
author's profile photo Former Member
Former Member

SOLR - Indexing extended product attribute via impex

Hi, I am using Hybris 5.6 and I am trying to achieve SOLR search results on extended product attributes.

I have a custom model itemtype in core-items.xml file which extends Product model. This extended product model has an attribute "brandId". I want to index this attribute in SOLR and whenever I search by brand, I should be able to see search results for that particular brand.

I want to achieve this by executing an impex script after initialization. After running SOLR indexer wizard, I execute below impex,

INSERT_UPDATE SolrIndexedProperty; solrIndexedType(identifier)[unique=true]; name[unique=true]; type(code); sortableType(code); currency[default=false]; localized[default=false]; multiValue[default=false]; useForSpellchecking[default=false]; useForAutocomplete[default=false]; fieldValueProvider; valueProviderParameter ; $solrIndexedType ; brandId ; text ; ; ; true ; ; true ; true ; springELValueProvider ; "getBrandId()"

Finally when I open storefront and search for specific brand (even though I can see those brands in products in HMC), SOLR search returns no results.

What could I be missing?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 09, 2015 at 07:52 PM

    Hello,

    Ok so first of all, best practice when extending an itemtype is to create your own extension and put your new type definition in yourextension-items.xml .

    Second, when you add a new indexing property to your facetsearch config (or when you change anything in your facet search config anyway), you should update your index right after other wise your Solr server isnt aware of it. This can be easily done by following what's shown in https://wiki.hybris.com/display/release5/Updating+Solr+Index

    Please let me know if you need more help. Kind Regards,

    Amel.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.