Posts

How to install a standalone Solr server in SAP Hybris?

In this post, you will learn how to install and configure a standalone Solr server in a way that can be used in SAP Hybris Commerce. Prerequestion solrserver  extension should be there in your  localextensions.xml  file Hybris OOTB Solr configuration background The default configuration is as follows: solrserver . instances . default . autostart = true solrserver . instances . default . mode = standalone solrserver . instances . default . hostname = localhost solrserver . instances . default . port = 8983 solrserver . instances . default . memory = 512m Here, you can see  autostart=true  which tell Solr server to start and stop together with the Hybris platform. In another word, we can say default configuration ensures that a standalone Solr server is configured, started and stopped together with the platform. Setup external Standalone Server As we have seen, OOTB (post hybris v5.5) solr server is already configured as standalone server  mode=standalone . It mean

Hybris flexible search query examples

Use of Enum in the query Find all running Solr Index jobs select {cj.code},{enum:code},{cj.startTime},{cj.endTime} from { SolrIndexerCronJob! as cj join EnumerationValue as enum on {cj.status}={enum.pk} } where {enum:code} = 'RUNNING' Compare Date in the flexiblesearch query Find all running Solr Index jobs from the given date select {cj.code},{enum:code},{cj.startTime},{cj.endTime} from { SolrIndexerCronJob! as cj join EnumerationValue as enum on {cj.status}={enum.pk} } where {enum:code} = 'RUNNING' and {cj.startTime} >= TO_DATE('2021/12/25','YYYY/MM/DD') Basic  JOIN  and  IN  query Get the most recent order for each customer using flexible search. select {o.code} as orderCode, {c.name} as name, {a.cellphone} as cellphone from {order as o join Customer as c on {c.pk} = {o.user} join Address as a on {o.deliveryaddress} = {a.pk} } where {o.code} in ({{select max({cod