Bug 663843

Summary: RFE: implement search for bundles
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: ProvisioningAssignee: John Mazzitelli <mazz>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 4.0.0.B02CC: jshaughn
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Mazzitelli 2010-12-17 02:38:44 UTC
see BundlesDataSource:

        // TODO: this doesn't work like I think it should, figure out how to search on the name column 
        // if (request.getCriteria().getValues().get("search") != null) {
        //       criteria.setSearchExpression(request.getCriteria().getValues().get("search").toString());
        // }

(08:57:21 PM) mazz: who knows how to use org.rhq.core.domain.criteria.Criteria.setSearchExpression(String)
(08:57:28 PM) mazz: I set it, but I get a NPE on the server
(08:57:43 PM) mazz: of course, I have no way of telling the Criteria object which field I want the search to be on
(08:57:51 PM) mazz: I have a feeling this doesn't work like I think it does
(08:58:25 PM) mazz: since this is on the generic Criteria object, I assumed I can set a search expression, tell it to search on the "name" column and have it "just work". I'm trying this on BundlesCriteria
(09:18:19 PM) JimMa [~jimma.97.98] entered the room.
(09:29:23 PM) joseph42: mazz, the search expression is only implemented for resources and groups
(09:29:40 PM) joseph42: anything else throws NPE because there is no underlying classes for it
(09:30:26 PM) ckannan_away is now known as ckannan
(09:30:53 PM) joseph42: but, it's pretty easy to extend search if you want to try it out
(09:32:37 PM) joseph42: see concrete descendants of AbstractSearchAssistant, AbstractSearchTranslator
(09:35:16 PM) joseph42: basically you have to define the search terms for a bundle, tell the translator whether they are simple (name=value) or complex (name[param]=value) and then write the small bit of translation code necessary for that term

Comment 1 Joseph Marques 2010-12-17 04:01:29 UTC
* add a new enum to SearchSubsystem
* implement new classes: AbstractSearchAssistant, AbstractSearchTranslator
* augment lookup classes: SearchAssistantFactory, SearchTranslatorFactory
* add automatic recalculation of estimated saved search result counts: SavedSearchResultCountRecalculationJob

that should be it.

Comment 2 Jay Shaughnessy 2014-07-01 17:23:55 UTC
This could still be useful for installations with a lot of bundles.