Index: trunk/grails-app/controllers/InventoryItemDetailedController.groovy
===================================================================
--- trunk/grails-app/controllers/InventoryItemDetailedController.groovy	(revision 565)
+++ trunk/grails-app/controllers/InventoryItemDetailedController.groovy	(revision 566)
@@ -148,4 +148,5 @@
                 params.searchComment = session.inventoryItemSearchComment
                 params.searchLocation = session.inventoryItemSearchLocation
+                params.searchGroup = session.inventoryItemSearchGroup
                 params.searchSpareFor = session.inventoryItemSearchSpareFor
             }
@@ -186,4 +187,5 @@
             session.removeAttribute("inventoryItemSearchComment")
             session.removeAttribute("inventoryItemSearchLocation")
+            session.removeAttribute("inventoryItemSearchGroup")
             session.removeAttribute("inventoryItemSearchSpareFor")
             session.removeAttribute("inventoryItemQuickSearch")
@@ -203,4 +205,5 @@
             session.inventoryItemSearchComment = params.searchComment
             session.inventoryItemSearchLocation = params.searchLocation
+            session.inventoryItemSearchGroup = params.searchGroup
             session.inventoryItemSearchSpareFor = params.searchSpareFor
             // Clear any previous search.
@@ -228,4 +231,5 @@
             session.removeAttribute("inventoryItemSearchComment")
             session.removeAttribute("inventoryItemSearchLocation")
+            session.removeAttribute("inventoryItemSearchGroup")
             session.removeAttribute("inventoryItemSearchSpareFor")
             session.removeAttribute("inventoryItemSearchFilterParams")
Index: trunk/grails-app/domain/InventoryGroup.groovy
===================================================================
--- trunk/grails-app/domain/InventoryGroup.groovy	(revision 565)
+++ trunk/grails-app/domain/InventoryGroup.groovy	(revision 566)
@@ -12,3 +12,9 @@
 
     String toString() {"${this.name}"}
+
+    static searchable = {
+        root false // only index as a component of InventoryItem.
+        only = ['name']
+    }
+
 }
Index: trunk/grails-app/domain/InventoryItem.groovy
===================================================================
--- trunk/grails-app/domain/InventoryItem.groovy	(revision 565)
+++ trunk/grails-app/domain/InventoryItem.groovy	(revision 566)
@@ -62,7 +62,8 @@
 
     static searchable = {
-        only = ['name', 'description', 'comment', 'inventoryLocation', 'spareFor']
+        only = ['name', 'description', 'comment', 'isActive', 'isObsolete', 'inventoryLocation', 'inventoryGroup', 'spareFor']
         //name boost: 1.5
         inventoryLocation component: true
+        inventoryGroup component: true
         spareFor component: true
     }
Index: trunk/grails-app/services/InventoryItemSearchService.groovy
===================================================================
--- trunk/grails-app/services/InventoryItemSearchService.groovy	(revision 565)
+++ trunk/grails-app/services/InventoryItemSearchService.groovy	(revision 566)
@@ -159,10 +159,41 @@
         // Build searchableParams.
         // Do not include params.sort, since not all properites are indexed.
-        def searchableParams = [max: params.max, offset: params.offset,
-                                                    reload: true, defaultOperator: 'or']
+        def searchableParams = [:]
+        searchableParams.max = params.max
+        searchableParams.offset = params.offset
+        searchableParams.reload = true
+        searchableParams.defaultOperator =  'or'
+        def properitesList = []
+        if(params.searchName)
+            properitesList << '$/InventoryItem/name'
+        if(params.searchDescription)
+            properitesList << '$/InventoryItem/description'
+        if(params.searchComment)
+            properitesList << '$/InventoryItem/comment'
+        if(params.searchLocation)
+            properitesList << '$/InventoryItem/inventoryLocation/name'
+        if(params.searchGroup)
+            properitesList << '$/InventoryItem/inventoryGroup/name'
+        if(params.searchSpareFor) {
+            properitesList << '$/InventoryItem/spareFor/name'
+            properitesList << '$/InventoryItem/spareFor/description'
+            properitesList << '$/InventoryItem/spareFor/comment'
+        }
+        if(properitesList)
+            searchableParams.properties = properitesList
+
+        // Require isActive and isObsolete.
+        def queryString = '( '+result.searchText+' )'+ ' AND isActive:"true" AND isObsolete:"false"'
 
         // Perform the searchable query.
         try {
-            result.inventoryItemList = InventoryItem.search(result.searchText, searchableParams)
+            result.inventoryItemList = InventoryItem.search(queryString, searchableParams)
+
+            // Would be nice if this worked.
+//             result.inventoryItemList = InventoryItem.search(result.searchText, searchableParams) {
+//                 must(term("isActive", true))
+//                 must(term("isObsolete", false))
+//             }
+
         } catch (e) {
             log.error e
Index: trunk/grails-app/views/inventoryItemDetailed/search.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/search.gsp	(revision 565)
+++ trunk/grails-app/views/inventoryItemDetailed/search.gsp	(revision 566)
@@ -271,16 +271,34 @@
                         <tr class="prop">
                             <td valign="top" class="name">
+
+                                <jsUtil:toggleControl toggleId="limitSearch"
+                                                                        imageId="limitSearchImg"
+                                                                        closedImgUrl="${resource(dir:'images/skin',file:'bullet_toggle_plus.png')}"
+                                                                        openImgUrl="${resource(dir:'images/skin',file:'bullet_toggle_minus.png')}"
+                                                                        effect="fade"
+                                                                        text="Limit Search"
+                                                                        />
                             </td>
                             <td valign="top" class="value">
-<!--                                 <g:checkBox name="searchName" value="${true}" ></g:checkBox> -->
-                                <label for="searchName">Name,</label>
-<!--                                 <g:checkBox name="searchDescription" value="${true}" ></g:checkBox> -->
-                                <label for="searchDescription">Description,</label>
-<!--                                 <g:checkBox name="searchComment" value="${true}" ></g:checkBox> -->
-                                <label for="searchComment">Comment,</label>
-<!--                                 <g:checkBox name="searchLocation" value="${true}" ></g:checkBox> -->
-                                <label for="searchLocation">Location and</label>
-<!--                                 <g:checkBox name="searchSpareFor" value="${true}" ></g:checkBox> -->
-                                <label for="searchSpareFor">Spare For (Asset: name, description and comment).</label>
+                                <g:if test="${params.searchName || params.searchDescription || params.searchComment || params.searchLocation || params.searchGroup || params.searchSpareFor}" >
+                                    <div id="limitSearch">
+                                </g:if>
+                                <g:else>
+                                    <div id="limitSearch" style="display:none;">
+                                </g:else>
+                                    <g:checkBox name="searchName" value="${params.searchName}" ></g:checkBox>
+                                    <label for="searchName">Name</label>
+                                    <g:checkBox name="searchDescription" value="${params.searchDescription}" ></g:checkBox>
+                                    <label for="searchDescription">Description</label>
+                                    <g:checkBox name="searchComment" value="${params.searchComment}" ></g:checkBox>
+                                    <label for="searchComment">Comment</label>
+                                    <g:checkBox name="searchLocation" value="${params.searchLocation}" ></g:checkBox>
+                                    <label for="searchLocation">Location</label>
+                                    <g:checkBox name="searchGroup" value="${params.searchGroup}" ></g:checkBox>
+                                    <label for="searchGroup">Group</label>
+                                    <br />
+                                    <g:checkBox name="searchSpareFor" value="${params.searchSpareFor}" ></g:checkBox>
+                                    <label for="searchSpareFor">Spare For (Asset: Name, Description and Comment).</label>
+                                </div>
                             </td>
                         </tr>
