cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

in my customSolrQueryConverter i want to prevent the products which has sapBlockedDate < currentDate from the search result

Former Member
0 Likes
159

like
if (StringUtils.isNotEmpty(rootOrgUnit))

     {
         query = "(" + query + " ) AND ((skuType_string : " + SKUTYPE_STANDARD + ")" + " OR  

(skuType_string : " + SKUTYPE_BASEPRODUCT + ")" + " OR ((skuType_string : " + SKUTYPE_NON_STANDARD + ")" + " AND (assignedOrgUnit_string_mv : " + rootOrgUnit + ")))";

     }

              
     else
     {
         query = "(" + query + " ) AND (!(itemtype_string : " + PRODUCT_TYPE + ") ";
     }  

     return query;  

i have the field as sapBlockedDate_date which needs to be greater than today's date.
How can i achieve this in appending through query

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Likes

This is a lucene specific question, you can find the answer in the documentation: https://lucene.apache.org/solr/guide/6_6/working-with-dates.html

Also it must be mentioned that the interface SolrQueryConverter is deprecated since 5.7 and is only effective in case of the deprecated legacy mode. please refer to the search API for non legacy mode: https://help.hybris.com/6.7.0/hcd/8c547232866910149b829fe3ca8e0358.html

Former Member
0 Likes

it works but need to change date format to "yyyy-MM-dd'T'HH:mm:ss'Z''"

Ask a Question