Solr Overview in Hybris
Please go through the solr related articles in Solr articles page before understanding Solr in Hybris.
Most of the eCommerce sites provide search functionality on their sites and especially for searching products details.
Products are the main searching data in any eCommerce site.
Since Hybris is used for developing eCommerce sites,Solr in Hybris is used for making faster search on the products in the site.
Look at the below diagram on how Solr is used in Hybris
Whenever user access any data in the storefront, it can come from either hybris DB or from Solr based on whether that data is indexed or not.
If data is indexed ,it will be stored separately in Solr and can be accessed from there.
If data is not indexed, it will be anyway available in Hybris DB and can be accessed from there.
Communication between Solr and Hybris DB is one way because Solr only gets the data from Hybris DB but it will not write anything back to Hybris DB.
Hybris calls the Cron job for indexing, then Solr gets the source data from Hybris DB and then it does the indexing and save the indexed data within it.
Remember:
Accessing data from Hybris DB will take more time than accessing it from Solr because of indexed data in Solr, hence Solr is preferred in searching than Hybris DB.
If you still don’t understand why solr is preferred for searching, No problem, please go through these solr articles once again Solr articles
Solr in hybris supports 3 types of indexing strategies
1)Full indexing
2)Update indexing
3)Delete indexing
1) Full indexing:
In this strategy, all the existing indexed documents will be deleted first and then fresh indexing will be done from the scratch.
It takes considerable amount of time, so not advised to do it frequently.
Full indexing supports 2 modes of commit
a)Direct mode
In this mode,if indexing fails then previously committed documents will be available.
b)Two phase mode
In this mode, if indexing fails, everything will be rolled back to initial state.
In this mode,Solr creates one extra core as a temporary core only for indexing, once indexing is success then it will be swapped with original core.
So original core will be safe in case of failure in indexing.
It is called Two phase mode mainly because it has 2 Solr cores involved while indexing.
The initial core is kept as a backup and other one is created as a copy
Indexing will be performed on this copy which will be later swapped with original core if indexing gets success.
2) Update indexing:
In this strategy, only those documents which have been modified within some given time will be indexed and other indexed documents remains as it is.
This operation can be done frequently if needed as it consumes less time compared to Full indexing strategy
3) Delete indexing:
This strategy is used to completely remove the indexed documents.
This should be done periodically to maintain the consistency of indexed data as we might have unwanted indexed data in Solr from a long time.
What can be indexed in Hybris ?
We can index any hybris item type using either HMC or Impex.
As we all know doing through impex is the best way as it lasts long and reusable in all the environments(DEV,TEST,PROD)
We just need to define the Solr configuration in the impex file accordingly.
Indexing for Product item type is already done by Hybris out of the box.
So if we add any new attributes to Product item type and we want those new attributes to be indexed then we need to add those new attributes in the solr impex file.
We can define the queries in solr impex file to get the data from hybris DB for indexing and we also need to define the fields descriptions in the Solr impex file.
Good part with Hybris is that, it has already provided cron jobs for performing full indexing,update indexing and delete indexing.
Informative overview of Solr in Hybris! Well-structured content and helpful explanations. Thanks for simplifying Solr integration for Hybris developers.
Hello Sir,
Could you just correct me might be am thing wrong. I think you have written misplace for direct and two phase.
a)Direct mode
In this mode,if indexing fails then previously committed documents will be available.
b)Two phase mode
In this mode, if indexing fails, everything will be rolled back to initial state.
hello Sir I hope that you’re fine , let me say firstly i want to thank uu so much for your tuto in javasimpleway websitethanks i have question : if i want to clean my product and catalog to intialize for a new website in hybris for an example microsoft want use hybris i need in storefront and backoffice just the product of microsoft i mean all product of hybris i want to delete them thanks a lot
Hi Karibasappa,
First of all, thanks a lot for sharing all the valuable information with us.
Currently I am stuck in a scenario:-
I have to implement solr search on B2B units.
There are 5 indexed properties – prop1, prop2, prop3, prop4 and prop5 (these are dummy names)
Fuzzy is enabled only for prop4 and prop5
FTS and Wildcard search is enabled for all the properties
Requirement says there will be 5 separate text boxes on frontend and user can enter separate texts in each of the box (each box for individual property). Text search needs to be performed on each field.
i.e. the value entered in text box for prop1 – need to perform FTS and wildcard search on that value
How can I combine each result to achieve this functionality.
Any help would be really valuable for me…
Thanks in advance
Please provide steps for adding and displaying video for hybris product.
Arrow mark given in the diagram should be from Hybris DB To Solr as per the concept given “Communication between Solr and Hybris DB is one way because Solr only gets the data from Hybris DB but it will not write anything back to Hybris DB”. But it is shown from Solr to Hybris DB.
You are right, Will update the arrow mark.
Thanks !!
can you please explain how to index GenericVariantProduct in SOLR?
also, if possible please provide details about providers we may need to write
Hi karibasappa,
I have a case where indexing is running successful but i’m not able to view products in the back office under catalog, can you tell me the issue
i even does not added any filter .
i have runned full indexing.
Hi sir.,
Can you please explain solar.xml and solar config.xml
HI,
Was looking for hybris related article to understand the basics & the structure. very nicely explained. thank you very much. Keep up the good work.
Can you please an article on Promotions. Like how to create custom promotion.
Can you please add tutorial for backoffice ?
very grateful to you Karibasappa G C
for putting so much effort in making hybris so easy to understand.
add some thing on order management sir
Wonderful article. Just love the way you explain. Thanks a ton!!
Thanks a lot !!
Hi KB,
Can you provide an article about value providers, How to create it and use of it?
Please check below article
http://javainsimpleway.com/value-provider-in-solr-with-example/
And How can we apply solr keywords redirection for indexed properties.
Hi Karibasappa G C,
Can you please explain about the solr keywords rediection in one article.
Thanks!!
Hi Karibasappa G C,
Can you please explain about the spellCheckers and it configurations and what is the Schema.xml, solrConfig.xml files please expalin in one article
Sure, will do it.
Can u provide the example when we need two more lable for the registration page like address and citi .
wait for example.
U example so clean and so simple that every one can understand.
The above example for wcms ,solr and cron job using which hybris version u have done,
plse update .
Hi KB Sir,
Thank you for such nice explanation on Hybris. I have just joined the company and new to the platform ,have learned so many things with the help of these article.
just a small question. Will the ProductModel,CustomerModel etc etc will be covered ? It is tough trying to understand these things from wiki when you are a freshers.
Can you please guide me regarding this?
Thank u again
Hi Priyanka,
ProductModel,CustomerModel etc are the predefined model classes by hybris , there is nothing much to understand except how they are related each other and how they can be used.
Its explained in wiki, just understand its hierarchy and relation.
Thank you !!
Hi KB,
Your article is simple awesome!!! for learning Sap Hybris especially.
Can you please tell me the cron job names for
performing full indexing,update indexing and delete indexing.
Thanks in advance.
Hi KB,
Very nice articles.I want to know the meaning of indexed data?
Thanks!
Please check below article
http://javainsimpleway.com/what-is-indexing/
one more very nicely explained article
Thank you !!
Hi,
how to enable B2B reuest quote button in hybris 6.3.
Nice explanation KB…you have provided information in a nice and easy way…
Thanks Bhavyesh!
Hi KB,
Your articles here are very interesting, well written, and touch on a few topics that the Hybris help seems to leave out. Thank you.
One topic I haven’t seen written about anywhere is how to organize a Hybris Commerce git repository so that multiple developers can work effectively with it. With a combination of configuration, generated code, standard code, custom extensions, impex scripts, and things like ext-data, it’s hard to figure out a good strategy for this.
Do you know of some resources that discuss these topics ?
Thanks again for your posts!
Hi Roger,
Thanks for the compliments !!
Its nothing much different in git configuration with Hybris but i will try to post an article on this as i dont know any forum has provided this or not at this moment.
Its just like any other project, you will have a repository for hybris and it will be configured to checkin only custom folder.
so any modification we do should be inside the custom folder.
Thanks!!
Hi karibasappa, ur way of explaining the article about each module is so good , can u please upload some modules description like OMS and Backoffice . so that it will be some more helpfull for the people who are doing projects or some people who want to learn new things . If there is a time please right the article and upload it .
Hi Dev,
I will surely do it,Please give me some time as i am working on some other concepts of Hybris as of now.
Thanks!!