<?xml version="1.0" encoding="utf-8"?>
<section id="GuideImageSearchSearch">
  <title id="titleGuideImageSearchSearch">Search Window</title>
  <para>Geeqie provides a utility to find one or more images based on various parameters.</para>
  <para>
    To display a new Search Window press
    <keycap>F3</keycap>
    or select
    <guimenu>Search</guimenu>
    from the File menu.
  </para>
  <para>
    To start a search activate the
    <code>
      <guibutton>
        <guiicon>
          <inlinegraphic fileref="edit-find.png" />
        </guiicon>
        Find
      </guibutton>
    </code>
    button or press
    <code>Ctrl + Enter</code>
    . A search in progress can be stopped by activating the
    <code>
      <guibutton>
        <guiicon>
          <inlinegraphic fileref="process-stop.png" />
        </guiicon>
        Stop
      </guibutton>
    </code>
    button or press
    <code>Ctrl + Enter</code>
    .
  </para>
  <para>The progress of an active search is displayed as a progress bar at the bottom of the window. The progress bar will also display the total files that match the search parameters, and the total number of files searched.</para>
  <para>When a search is completed, the total number of files found and their total size will be displayed in the status bar.</para>
  <para />
  <section id="Searchlocation">
    <title>Search location</title>
    <para>One of several locations can be chosen as the source to use in the search.</para>
    <variablelist>
      <varlistentry>
        <term>
          <guilabel>Path</guilabel>
        </term>
        <listitem>The search will include files located in the selected folder, enable the Recurse check box to include the contents of all sub folders.</listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Comments</guilabel>
        </term>
        <listitem>
          This option is only for use with GqView legacy metadata.
          <para />
          The search will include all files that have a keyword or comment associated to it.
          <note>Only keyword and comment associations stored in the user's home folder are included in this search type.</note>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Results</guilabel>
        </term>
        <listitem>The search will include all files currently listed in the results list. Use this to refine a previous search.</listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Collection</guilabel>
        </term>
        <listitem>The search will include all files in the selected collection.</listitem>
      </varlistentry>
    </variablelist>
    <para />
    <para />
  </section>
  <section id="Searchparameters">
    <title>Search parameters</title>
    <para>Each search parameter can be enabled or disabled with the check box to its left. For a file to be a match, all enabled parameters must be true.</para>
    <variablelist>
      <varlistentry>
        <term>
          <guilabel>File</guilabel>
        </term>
        <listitem>
          If "name is" is selected, the search will match if the text exactly matches the file name. If "name contains" or "path contains" is selected, the search will match if the entered text appears within the file name or path.<para/>The text comparison can be made to be case sensitive by enabling the Match case checkbox.
          <para />
          If "contains" or "path contains" is selected,
          <link linkend="GuideReferencePCRE">Perl Compatible Regular Expressions</link>
          are used.
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>File size</guilabel>
        </term>
        <listitem>
          The search will match if the file size on disk is equal to, less than, greater than, or between the entered value, depending on the method selected from the drop down menu. The
          <emphasis>between</emphasis>
          test is inclusive - for example a file of size 10 will match if the size parameters are between 10 and 15.
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>File date</guilabel>
        </term>
        <listitem>
          The search will match if the file date is equal to, before, after, or between the entered date, depending on the method selected from the drop down menu. The
          <emphasis>between</emphasis>
          test is inclusive, for example a file with date of 10/04/2003 will match if the date parameters are between 10/04/2003 and 12/31/2003.
          <para />
          For convenience, the
          <code>
            <guibutton>
              <guiicon>
                <inlinegraphic fileref="go-down.png" />
              </guiicon>
            </guibutton>
          </code>
          button displays a pop up calendar to enter the date.
          <para />
          One of four date types may be selected. They are described in the
          <link linkend="GuideReferenceFileDates">Reference section</link>
          .
          <note>If an image does not have an exif date, it will default to 01 January 1970.</note>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Image dimensions</guilabel>
        </term>
        <listitem>
          The search will match if the image dimensions are equal to, less than, greater than, or between the entered values, depending on the method selected from the drop down menu. The
          <emphasis>between</emphasis>
          test is inclusive.
          <para />
          The image dimensions test is simple, both width and height must be within the allowed values for a match.
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Image content</guilabel>
        </term>
        <listitem>
          The search will match if the image contents are similar within the percentage value, inclusive. This uses the same test and data that is used to determine image similarity when
          <link linkend="GuideImageSearchFindingDuplicates">Finding Duplicates</link>
          . The entry is for entering the path for the image to use in this test.
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Keywords</guilabel>
        </term>
        <listitem>The search will match if the file's associated keywords match all, match any, or exclude the entered keywords, depending on the method selected from the drop down menu. Keywords can be separated with a space, comma, or tab character.</listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Comment</guilabel>
        </term>
        <listitem>
          The search will match if the file's Comments field contains the entered pattern.
          <link linkend="GuideReferencePCRE">Perl Compatible Regular Expressions</link>
          are used.
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Geocoded position</guilabel>
        </term>
        <listitem>
          The search will match if the file's GPS position is less than or greater than the selected distance from the specified position, or is not geocoded, depending on the method selected from the drop down menu.
          The search location can be specified by
          <itemizedlist>
            <listitem>
              Type in a latitude/longitude in the format
              <code>89.123 179.123</code>
            </listitem>
            <listitem>Drag-and-drop a geocoded image onto the search box</listitem>
            <listitem>If Geeqie's map is displayed, a left-click on the map will store the latitude/longitude under the mouse cursor into the clipboard. It can then be pasted into the search box.</listitem>
            <listitem>Copy-and-paste (in some circumstances drag-and-drop) the result of an Internet search.</listitem>
          </itemizedlist>
          <note>
            In this last case, the result of a search may contain the latitude/longitude embedded in the URL. This may be automatically decoded with the help of an external file:-
            <programlisting xml:space="preserve">$HOME/.config/geeqie/geocode-parameters.awk</programlisting>
            See
            <link linkend="GuideReferenceDecodeLatLong">Decoding Latitude and Longitude</link>
            for details on how to create this file.
          </note>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Class</guilabel>
        </term>
        <listitem>
          The search will match if the file's class is, or is not, one of the following types.
          <itemizedlist>
            <listitem>Unknown</listitem>
            <listitem>Image</listitem>
            <listitem>Raw Image</listitem>
            <listitem>Video</listitem>
            <listitem>Document</listitem>
            <listitem>Metadata</listitem>
            <listitem>Unknown</listitem>
            <listitem>Broken (Of class Image, Raw Image, Video, or Document, but Geeqie cannot display an image)</listitem>
          </itemizedlist>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Marks</guilabel>
        </term>
        <listitem>
          The search will match if the file does or does not have a mark attached to it. Refer to
          <link linkend="GuideImageMarks">Marking Images</link>
          .
        </listitem>
      </varlistentry>
    </variablelist>
    <para />
    <para />
  </section>
  <section id="Resultslist">
    <title>Results list</title>
    <para>Files that match the parameters of the search are shown in the list. By default they are displayed in the order that they are found. To sort the results list by a column, activate or click the column title. Activating a column that is already used to sort the list will toggle between increasing and decreasing sort order.</para>
    <para>
      A
      <emphasis role="strong">context menu</emphasis>
      is available for the result list by right clicking the mouse or pressing the Menu key when a row has the focus.
    </para>
    <para>
      The
      <link linkend="GuideReferenceKeyboardShortcuts" endterm="titleGuideReferenceKeyboardShortcuts" />
      available are listed here.
    </para>
    <para>The image Dimensions column of the result list will only contain dimension information when dimensions are included in the search parameters.</para>
    <para />
  </section>
  <section id="Statusbar">
    <title>Status bar</title>
    <para>At the bottom of the search window is an area that includes the following items from left to right:</para>
    <variablelist>
      <varlistentry>
        <term>
          <guilabel>Thumbnails</guilabel>
        </term>
        <listitem>Enable this check box to display a thumbnail next to each image in the results list.</listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>File count display</guilabel>
        </term>
        <listitem>Displays the total count of files in the results list, and their size on disk. The count of selected files will appear in parenthesis.</listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Search progress</guilabel>
        </term>
        <listitem>When a search is active, the text “Searching...” will appear here. Two numbers in parenthesis will also be displayed, the first number is the number of files that match the search parameters and the second number is the total number of files that were searched.</listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <code>
            <guibutton>
              <guiicon>
                <inlinegraphic fileref="edit-find.png" />
              </guiicon>
              Find
            </guibutton>
          </code>
        </term>
        <listitem>Activate the find button to start a search with the selected parameters.</listitem>
      </varlistentry>
      <para />
      <varlistentry>
        <term>
          <code>
            <guibutton>
              <guiicon>
                <inlinegraphic fileref="process-stop.png" />
              </guiicon>
              Stop
            </guibutton>
          </code>
        </term>
        <listitem>Activate the stop button to end a search that is in progress.</listitem>
      </varlistentry>
    </variablelist>
    <para />
    <para />
  </section>
  <section id="DragandDrop">
    <title>Drag and Drop</title>
    <para>Drag and drop can be initiated with the primary or middle mouse buttons. Dragging a file that is selected will include all selected files in the drag. Dragging a file that is not selected will first change the selection to the dragged file, and clear the previous selection.</para>
    <para />
  </section>
</section>
