The plugin ‚NGG Smart Image Search‘ enables the user to search for images by using various searchstrings. In its simplest form it will search for the complete text (= original searchstring) entered into the searchbox of a widget in the sidebar or into the searchbox of a shortcode on a searchpage. By default the resultlist will be ordered by descending image ids, i.e. the last uploaded images first.

Before being passed to a database query the searchstring is sanitized for security reasons, i.e. special characters are being taken care of. Depending on the settings of the webmaster, the searchstring will be searched for in the title of an image, in the description of an image, in the filename or in the tags assigned to an image. An image will show up in the search result list, if the searchstring is contained in any of the image fields title, description, filename or in any of its tags and if the image is not excluded from display by NextGEN gallery and if the hosting gallery is not excluded from the search by webmaster settings.

The webmaster has the option to configure a search differently for public users or for logged in users.

Standard searches

The standard search action is to search for the complete searchstring.

Example:  searchstring „sun“ will search for all images having this textstring „sun“ contained in either title, description, filename or tags. It will find terms like ‚morning sun‘, ’sunset‘, ’sunday‘, ’sunglasses‘ etc.. The searchstring may also have leading or trailing blanks. So the searchstring „ sun “ will only find the term ‚morning sun ‚, but not terms like ’sunset‘, ’sunday‘ etc..

Currently there are in addition to the complete searchstring also some special search codes available:

  1. r:<nn>
    This will search for the <nn> most recent images.
    Here the term ‚recent images‘ is used as by NextGEN gallery, i.e. it looks for the images with the most recent imagedates (imagedates as given by the image exif data).
    Example:  r:15  will search for the 15 most recent images.
  2. l:<nn>
    This will search for the <nn> last uploaded images.
    When uploading, NextGEN gallery will use automatically incremented picture ids = pid.
    Example:  l:15  will search for the 15 last uploaded images independent of their imagedate.
  3. g:<nn>
    This will search for all images in gallery <nn>.
    By default this search option is only available for logged in users.
    Also by default, it will even list excluded images. As mentioned above, the gallery is only listed if this gallery is not being excluded by webmasters settings.
    Example: g:3  will list all images of gallery 3.

Advanced searches

Standard searches only search for the complete searchstring. In contrast to this will advanced searches search for a free combination of searchstrings.

Example: „sun & city & street“ will search for images which have all of these three terms in any of their fields title, description, filename or tags. Here the operator“ & “ stands for a logical AND and must have a trailing and a leading blank to be correctly recognized.

You can use any combination of searchstrings including special codes.

Example: „r:30 & tree & big“ will search for all images with reference to the strings ‚tree‘ and ‚big‘ and will list the 30 most recent found images.

Advanced searches can also use the exclusion operator“ -& „.

Example: „city & long street -& car“ will list all images with reference to ‚city‘ and ‚long street‘ which do not refer to the string ‚car‘.

Not all formally possible advanced searches are meaningful if combined with special search codes:

Example: „r:30 & l:30 & tree“ does not make sense, because you cannot sort the search list by date (r:30) and by upload order (l:30).

Finally, the search operators  ‚&‘ and ‚-&‘ can also be used at the beginning of the searchstring. However, ‚&‘ at the beginning will have no effect, as it does not change anything (the following search term will be searched anyway).

Example: „-& red sunset“ will search for all images not refering to ‚red sunset‘. In this case the search operator must not have a leading blank.

Complex searches

Whereas the symbols “ & “ and “ -& “ refer for their search to all search fields title, description, filename and tags, the following symbols

&a “ and „ -&a “  only refer to the field title (=alternate)

&d “ and “ -&d “ only refer to the field description

&f “ and “ -&f “ only refer to the field filename

&t “ and “ -&t “ only refer to tags of an image

Complex searches can use any order of combining symbols. By also including empty searchstrings or only blanks the complex searches can become quite tricky.

The symbols can also be used at the beginning of a searchstring, in that case only without a leading blank.

Example: „r:10 &t sunset -&t sea“ will search for images with tag ’sunset‘, which do not have a tag ’sea‘ at the same time. The result list will return the 10 most recent images.

Example „g:5 & r:3“  will return the three most recent images in gallery 5.

In principle you can also search for an empty searchstring. However, an empty searchstring is contained in any searchfield, so this does not make much sense. There is only one exception coded when an empty searchstring is restricted to tags:
Operator ‚&t‘ will search for images having ANY tags and ‚-&t‘ will search for images having NO TAGS at all.

Example „g:5 &t “ will search for all images in gallery 5, which have some tags.

Example „g:5 -&t “ will search for all images in gallery 5, which do not have any tags at all.

Dynamic display types for search results

As documented on the page display search result list  the layout of the search result list is determined by the display parameter of the shortcode hr_SIS_display_images. This display type is statically defined for the shortcode.

However, the user can dynamically override this static display type by using the desired display type as a suffix for the searchstring marked by a leading „>“ symbol.

Example: „sunset & city & clouds>at“ will show the search result list with an advanced thumbnails layout.  The suffix must directly follow the searchstring without gap.

27
Hinterlasse einen Kommentar

avatar
8 Kommentar Themen
19 Themen Antworten
1 Follower
 
Kommentar, auf das am meisten reagiert wurde
Beliebtestes Kommentar Thema
10 Kommentatoren
MartinAdministratorHArris SelphChrisJ. Riley Stewart Letzte Kommentartoren
  Abonnieren  
Benachrichtige mich bei
Martin
Gast

Gibt es eine Möglichkeit, einen Link / HTML zu erstellen? Dann ohne Suche bei mir im Widget. Aber mit das gleiche Antword.
Weil ich schon weiß, wonach das System suchen muss.

Danke für dieses nette Plugin!

HArris Selph
Gast
HArris Selph

Is there a way to list the galleries as a selction box and let people check which gallery they want to search?

Chris
Gast
Chris

Hi… are we not able to use Advanced or Complex searches when using a widget and not a shortcode? Thanks!

francesco
Gast

Good evening, congratulations for the plugin, you can view the name of the album in addition to the name of the photo gallery, thanks
Buona sera, complimenti per il plugin, è possibile visualizzare il nome dell’album oltre al nome della galleria delle foto , grazie

Carl Salvail
Gast

Hi, I try to make a search only in the album 2 and i want to display 200 images max.
laso I would like to search only in the TAGS, I cant find a code to specify that..

[hr_SIS_nextgen_searchbox search_album="2" limit="200" list_tags="1"]

[hr_SIS_display_images display="pt" ]

thank for you help, I would love to fix that code the right way! 🙂

Mark
Gast

Hello Harald,
I am having difficulty changing the default number of images displayed after a search from the default limit of 30. I am really not sure the exact syntax to use to set the limit or where to place it. (I am not using the Widget version, just the shortcodes on a page) Can you give a specific shortcode example that would set the returned number of images to say 150 results of any search term?

David Goebel
Gast

Hello,
can the admin see, what phrases have been searched for?
regards David

Edgar Müller
Gast

Hello Harald, I installed your ngg image search plugin and it works fine. I have one question: I’m working an a photostock site (www.bitcoinphotostock.com) and I wonder if there is any way to display the ngg thumbnails with the wp-shoping-cart template? I would very much like to integrate your plugin to search for photos with your plugin but displaying the shoppingcart info under every thumbnail. Please, go to my test page http://www.bitcoinphotostock.com > gallery.
Thank you for your possible assistance.

Regards, Edgar