question: public static String searchRemoveFromCategory ( HttpServletRequest request , HttpServletResponse response ) { Delegator delegator = ( Delegator ) request . getAttribute ( "delegator" ) ; String productCategoryId = request . getParameter ( "SE_SEARCH_CATEGORY_ID" ) ; String errMsg = null ; try { boolean beganTransaction = TransactionUtil . begin ( DEFAULT_TX_TIMEOUT ) ; try { EntityListIterator eli = getProductSearchResults ( request ) ; if ( eli == null ) { errMsg = UtilProperties . getMessage ( resource , "productsearchevents.no_results_found_probably_error_constraints" , UtilHttp . getLocale ( request ) ) ; request . setAttribute ( "_ERROR_MESSAGE_" , errMsg ) ; return "error" ; } int numRemoved = 0 ; GenericValue searchResultView = null ; while ( ( searchResultView = eli . next ( ) ) != null ) { String productId = searchResultView . getString ( "mainProductId" ) ; numRemoved += delegator . removeByAnd ( "ProductCategoryMember" , UtilMisc . toMap ( "productCategoryId" , productCategoryId , "productId" , productId ) ) ; } eli . close ( ) ; Map < String , String > messageMap = UtilMisc . toMap ( "numRemoved" , Integer . toString ( numRemoved ) ) ; errMsg = UtilProperties . getMessage ( resource , "productsearchevents.removed_x_items" , messageMap , UtilHttp . getLocale ( request ) ) ; request . setAttribute ( "_EVENT_MESSAGE_" , errMsg ) ; } catch ( GenericEntityException e ) { Map < String , String > messageMap = UtilMisc . toMap ( "errSearchResult" , e . toString ( ) ) ; errMsg = UtilProperties . getMessage ( resource , "productsearchevents.error_getting_search_results" , messageMap , UtilHttp . getLocale ( request ) ) ; Debug . logError ( e , errMsg , module ) ; request . setAttribute ( "_ERROR_MESSAGE_" , errMsg ) ; TransactionUtil . rollback ( beganTransaction , errMsg , e ) ; return "error" ; } finally { TransactionUtil . commit ( beganTransaction ) ; } } catch ( GenericTransactionException e ) { Map < String , String > messageMap = UtilMisc . toMap ( "errSearchResult" , e . toString ( ) ) ; errMsg = UtilProperties . getMessage ( resource , "productsearchevents.error_getting_search_results" , messageMap , UtilHttp . getLocale ( request ) ) ; Debug . logError ( e , errMsg , module ) ; request . setAttribute ( "_ERROR_MESSAGE_" , errMsg ) ; return "error" ; } return "success" ; }
target:  Removes the results of a search from the specified category