8335 Search All Repositories should match CLI default search behavior
authorJohn Rice <john.rice@sun.com>
Wed, 22 Apr 2009 18:57:14 +0100
changeset 1074 f6b6a4290aa2
parent 1073 b3ce02ccacbd
child 1075 2c935307c8ab
8335 Search All Repositories should match CLI default search behavior 8336 PM Search All Repositories is not clearing old search result when no matches found
src/gui/help/C/package-manager.xml.in
src/packagemanager.py
--- a/src/gui/help/C/package-manager.xml.in	Wed Apr 22 16:29:06 2009 +0100
+++ b/src/gui/help/C/package-manager.xml.in	Wed Apr 22 18:57:14 2009 +0100
@@ -206,15 +206,22 @@
 </itemizedlist>
 </listitem>
 <listitem><para><emphasis role="strong">Search all repositories</emphasis> – Select the multi-repository icon in the <literal>Search</literal> box to search for the package across all configured or registered repositories.</para>
-<note><para>The multi-repository search currently supports search based on the package description only.</para>
-</note>
-<para>Type a description of the package in the box. For example, the <filename>SUNWdiveintopython</filename> package is a book on Python programming. The description of the package contains <emphasis>book</emphasis>. To search for this package, you might then type one of the following terms:</para>
+<para>Note the following important considerations when using the multi-repository search.</para>
+<itemizedlist><listitem><para>The multi-repository search currently supports a search based on the package contents including its description, classification, and the files contained within the package. However, the correct results are displayed only if the term used for searching is an <emphasis role="strong">exact</emphasis> match.</para>
+</listitem>
+<listitem><para><emphasis role="strong">The multi-repository search does not search the package name</emphasis>.</para>
+</listitem>
+<listitem><para>Wild card searching is supported by using the asterisk wild card, <literal>*</literal>, in the search term. Search using the wild card can be slower than an exact match search.</para>
+</listitem>
+</itemizedlist>
+<para></para>
+<para>Type a description of the package in the box. For example, the <filename>SUNWdiveintopython</filename> package is a book on Python programming. The description of the package contains the string <emphasis>book</emphasis>. To search for this package, you might then type one of the following terms:</para>
 <itemizedlist><listitem><para>python</para>
 </listitem>
 <listitem><para>book</para>
 </listitem>
 </itemizedlist>
-<note><para>If you searched for the term <emphasis>dive</emphasis> in the multi-repository search, the <filename>SUNWdiveintopython</filename> package will not be displayed as the term is not present in the package description.</para>
+<note><para>If you searched for the term <emphasis>diveinto</emphasis> in the multi-repository search, the <filename>SUNWdiveintopython</filename> package will not be displayed as the term <emphasis>diveinto</emphasis> is not present as an independent, complete word in the package contents. However you will find the package using the <literal>*</literal> wild card. Hence, searching for the term <literal>diveinto*</literal> will display the <filename>SUNWdiveintopython</filename> package.</para>
 </note>
 </listitem>
 </itemizedlist>
@@ -567,4 +574,4 @@
 </glossdef>
 </glossentry>
 </glossary>
-</book>
+</book>
\ No newline at end of file
--- a/src/packagemanager.py	Wed Apr 22 16:29:06 2009 +0100
+++ b/src/packagemanager.py	Wed Apr 22 18:57:14 2009 +0100
@@ -43,7 +43,7 @@
 NOTEBOOK_START_PAGE = 1                   # Main View Start page index
 INFO_NOTEBOOK_LICENSE_PAGE = 3            # License Tab index
 TYPE_AHEAD_DELAY = 600    # The last type in search box after which search is performed
-SEARCH_STR_FORMAT = "<::description:*%s*>"
+SEARCH_STR_FORMAT = "<%s>"
 SEARCH_LIMIT = 100                        # Maximum number of results shown for
                                           # remote search
 MIN_APP_WIDTH = 750                       # Minimum application width
@@ -254,8 +254,8 @@
                     _("Search Current Repository (Name and Description)")),
                     ('ips-search-all',
                     gui_misc.get_icon_pixbuf(self.application_dir, 'search_all'),
-                    _("_All Repositories (Description Only)"),
-                    _("Search All Repositories (Description Only)"))
+                    _("_All Repositories (Exact Match)"),
+                    _("Search All Repositories (Exact Match)"))
                     ]
                 self.__register_iconsets(self.search_options)
 
@@ -1501,7 +1501,7 @@
                         gobject.idle_add(self.w_progress_dialog.hide)
                         gobject.idle_add(self.__handle_remote_search_error)
                         if len(result_tuple) == 0:
-                                self.__process_after_search_failure()
+                                self.__process_after_search_with_zero_results()
                                 return
                 except Exception, ex:
                         # We are not interested in this error
@@ -1516,7 +1516,7 @@
                 if len(result) == 0:
                         if debug:
                                 print "No search results"
-                        self.__process_after_search_failure()
+                        self.__process_after_search_with_zero_results()
                         return
                 result.reverse()
                 # We cannot get status of the packages if catalogs have not
@@ -1534,6 +1534,13 @@
                 gobject.idle_add(self.__set_main_view_package_list)
                 gobject.idle_add(self.__init_tree_views, application_list, None, None)
 
+        def __process_after_search_with_zero_results(self):
+                        self.in_setup = True
+                        application_list = self.__get_new_application_liststore()
+                        gobject.idle_add(self.__set_empty_details_panel)
+                        gobject.idle_add(self.__set_main_view_package_list)
+                        gobject.idle_add(self.__init_tree_views, application_list, None, None)
+
         def __get_list_from_search(self, search_result):
                 application_list = self.__get_new_application_liststore()
                 self.__add_pkgs_to_list_from_search(search_result,