Index Server G8 User manual (Version 3.0.0)  
 

2 Searching from remote clients

Spotlight searches range from simple queries to complex combinations of attributes. Search options may include Boolean logic (and/or/not), quoted phrases, keywords and values, and range support. Refer to 2.5 “Simple Spotlight search syntax” for details.

Note:

For performance reasons, changes in the index databases are flushed to disk only once per minute. Therefore, when a file has been created or modified, it may take up to a minute until a search will find the new or changed content. An instant flushing of the index databases of all volumes can be enforced by issuing srvutil reconf indexsrv on a command line as a superuser.

To ensure that new files in the volumes have a record in the desktop database it must be flushed as well, using the srvutil reconf desksrv command.

To perform Spotlight searches on a HELIOS volume, Spotlight indexing must be turned on for that volume, as described in 1.1 “Spotlight search settings in HELIOS Admin”.

2.1 Searching on OS X

On a OS X 10.5 or later client, the File > Find menu in the Finder opens a search window, allowing a file search by location, to search either local files on This Mac, or files in the currently selected folder, or files on Shared network volumes. In addition, a search by Contents or File Name can be specified.

hsymInstruction

In order to search for files in HELIOS volumes, select either Shared, or the HELIOS volume or directory name (navigate in the Finder to that directory first, then begin the search).

Spotlight searches can also be initiated via the Spotlight search dialog in the OS X menu bar. Such searches by default search only This Mac, so after the initial results are shown, select Show All to open the full search dialog, and then select Shared or the HELIOS volume as described above.

Further refining a search can be accomplished either by typing additional search criteria into the search field, or by clicking the + button in the search window location bar. A new menu then allows selecting additional criteria.

Searches can be saved simply by clicking the Save button, and renaming the resulting “Smart Folder”.

Searches for File Name will search for files with matching names. Searches for Contents will search for files with matching text content, metadata, or comments (Fig. 2.1).

The “Last Opened” attribute is not supported by Index Server, therefore this column is empty when searching in a HELIOS volume.

Search results on a Mac

Fig. 2.1: Search results on a Mac

2.2 Searching on Windows

Spotlight search via “HELIOS PCShare Search”

On a Windows client, you can search HELIOS network volumes for file content and metadata via the PCShare client tools “HELIOS PCShare Search” application (see HELIOS PCShare manual). The search can be limited to the current folder by starting the search from within the respective folder (Fig. 2.2).

Search results on a Windows PC

Fig. 2.2: Search results on a Windows PC

Note:

The simple Spotlight search syntax examples given in 2.4.1 “dt ftsearch” and in 2.5 “Simple Spotlight search syntax” can also be used with the HELIOS PCShare search.

Spotlight search via the “helsearch.exe” CLI tool

An option has been added to the CLI-based HELIOS tool “helsearch.exe”, which allows doing a search for file content and metadata in HELIOS network volumes from a Windows client. Please read the HELIOS PCShare manual to learn about the usage of this tool.

2.3 Searching from within WebShare

Likewise, the files with the searched content are found when searching in HELIOS network volumes with the WebShare search feature (Fig. 2.3).

If the Limit Search To Current Folder option is checked, the search is limited to the folder from which the search was started. Searches are case-insensitive.

Search results via WebShare in a web browser

Fig. 2.3: Search results via WebShare in a web browser

Note:

The simple Spotlight search syntax examples given in 2.4.1 “dt ftsearch” and in 2.5 “Simple Spotlight search syntax” can also be used with the HELIOS WebShare search.

When moving the cursor over the Spotlight search field in the WebShare toolbar, a link to a Spotlight search help pop-up window becomes visible (Fig. 2.4).

At the bottom of the Spotlight help window is another link: Show all indexed attributes displays, in a dynamically generated list, all attributes that are available for the current sharepoint (see 3.2 “Indexing modules”).

WebShare Spotlight Help pop-up

Fig. 2.4: WebShare Spotlight Help pop-up

2.4 Searching via “dt” tools

2.4.1 dt ftsearch

From a command line, you can search in HELIOS network volumes for file names, file content and metadata with this command.

Usage:

dt ftsearch [-n maxcount] [-v volume[/path/...]] [-i|-b] [-s]
            [-0] [-X] pattern
dt ftsearch -h

The following options are supported:

-0

Separate result paths with an ASCII null character.

-i

Print file ID with paths.

-b

Print file IDs only. Use this for efficient “dt ftsearch” and “dt ftinfo” scripting.

-n maxcount

Limit the number of search results to “maxcount”.

-v volume

Specify the volume path, default is the volume containing the current working directory. Additional directories after the volume path limit the search result to files that are below these directories.

-s

Use the advanced Spotlight search syntax (2.6 “Advanced Spotlight search syntax”) in the query instead of the simple Spotlight search syntax (2.5 “Simple Spotlight search syntax”).

-X

Suppress close delay for desktop database (see HELIOS Base manual; chapter “dt” tools).

-h

Display help text.

2.4.2 dt ftinfo

This command allows you to get Spotlight metadata information from a file in a HELIOS network volume. You may restrict the index attributes by specifying one or more index attributes, many of them listed in 3.2 “Indexing modules”.

Usage:

dt ftinfo [-k attribute[,attribute...]][-v volume][-A0ictX][-X] <file>
dt ftinfo -h

The following options are supported:

-A

Display all currently known attributes of a volume (current path or specify with -v option). <file> must be omitted.

-0

Separate output with ASCII null characters.

-k attribute

Print these attributes only.

-i

“file” is a file ID instead of a path. Use this for efficient “dt ftsearch” and “dt ftinfo” scripting.

-t

Add attribute type info to output.

-c

Check if “file” is indexed. Outputs the indexed text content.

-v volume

Specifies the volume path, default is the volume containing the current working directory. This option only has an effect if -i or -A is used.

-X

Suppress close delay for desktop database (see HELIOS Base manual; chapter “dt” tools).

-h

Display help text.

Example 1:

Obtain the indexed attributes of “IMGP0766.JPG”:

$ dt ftinfo IMGP0766.JPG
kMDItemPath=/demovol/IMGP0766.JPG
kMDItemDisplayName=IMGP0766.JPG
kMDItemContentModificationDate=2010-04-28 06:50:15 CEST
kMDItemFocalLength=5.800000
kMDItemKind=JPEG Image
kMDItemContentType=public.jpeg
kMDItemColorSpace=RGB
kMDItemPixelHeight=1728
kMDItemPixelWidth=2304
kMDItemBitsPerSample=24
kMDItemResolutionWidthDPI=72.000000
kMDItemResolutionHeightDPI=72.000000
kMDItemHasAlphaChannel=false
kMDItemProfileName=sRGB IEC61966-2-1 noBPC
kMDItemFSTypeCode=0
kMDItemAcquisitionMake=PENTAX Corporation
kMDItemAcquisitionModel=PENTAX Optio S4
kMDItemFSSize=1397604
kMDItemCreator=Optio S4 Ver 1.00
kMDItemFSOwnerUserID=501
kMDItemExposureTimeSeconds=0.016667
kMDItemFNumber=2.600000
kMDItemISOSpeed=100
kMDItemContentCreationDate=2010-04-28 05:50:15 CEST
kMDItemFSOwnerGroupID=80
kMDItemMaxAperture=2.800000
kMDItemMeteringMode=Pattern
kMDItemFlashOnOff=true
kMDItemFSName=IMGP0766.JPG
kMDItemFSContentChangeDate=2010-04-28 06:50:15 CEST
kMDItemFSCreationDate=2010-04-28 06:50:15 CEST
kMDItemFSCreatorCode=0
kMDItemFSFinderFlags=0
Example 2:

Obtain the attributes “kMDItemColorSpace” and “kMDItemContentCreationDate” from the image file “IMGP0766.JPG”:

$ dt ftinfo -k kMDItemColorSpace,kMDItemContentCreationDate
/demovol/IMGP0766.JPG
kMDItemColorSpace=RGB
kMDItemContentCreationDate=2010-04-28 05:50:15 CEST

2.5 Simple Spotlight search syntax

The simple Spotlight search syntax is used with the Mac Finder Spotlight search, the WebShare Spotlight search, the PCShare Spotlight search, and the “dt ftsearch” program.

Operator Description
: For numeric attributes: Equals numeric value
For string attributes: Equals (truncated) search term
For Boolean attributes: Equals 0=FALSE or 1=TRUE
:< Less than*
:> Greater than*
:<= Less than or equal*
:>= Greater than or equal*
AND (optional) Search term 1 and search term 2
OR Search term 1 or search term 2
- Not search term

Table 2.1: Operators for the simple Spotlight search syntax

* Available for numeric values and dates only
Time variable Description
now Last five minute's interval
today The current day
yesterday Yesterday
this week The current week
this month The current month
this year The current year
now(NUMBER) Five minute's interval, shifted by adding a positive or negative value to current time (in minutes)
today(NUMBER) A day, shifted by adding a positive or negative value to current day
yesterday(NUMBER) A day, shifted by adding a positive or negative value to yesterday
this week(NUMBER) A week, shifted by adding a positive or negative value to current week
this month(NUMBER) A month, shifted by adding a positive or negative value to current month
this year(NUMBER) A year, shifted by adding a positive or negative value to current year

Table 2.2: Simple Spotlight search – Time variables

Examples
 (Search a term in the full-text contents):
dt ftsearch job

Search for words starting with “job” in the file name, the contents and in all metadata attributes.

dt ftsearch "'print job logging'"

Search for the exact phrase “print job logging” in the contents and in all metadata attributes.

dt ftsearch "manual -car"

Search for “manual” but ignore all results containing “car”.

Note:

A search request must only contain letters and digits. Other characters, e.g. interpunction characters, will not return any results.

Examples
 (Search for specific metadata attributes):
Note:

See 4 “Searchable metadata attributes” for a list of all supported attribute names and aliases.

dt ftsearch "colorspace:RGB"

Search for RGB images.

dt ftsearch "height:<1000"

Search for images that are less than 1000 pixel high.

dt ftsearch "colorspace:CMYK dpi:>=300"

Search for CMYK images with a resolution of at least 300 dpi.

dt ftsearch "bps:24-32"

Search for images that have between 24 and 32 bits per sample.

dt ftsearch "modified:2010-09-15"

Search files modified on September 15, 2010.

dt ftsearch "date:2011-02-01-2011-02-11"

Search files with creation or modification date between February 1 and February 11, 2011.

dt ftsearch "modified:this week"

Search files modified this week.

dt ftsearch "modified:now(-20)"

Search files modified 20-25 minutes ago.

dt ftsearch "modified:today(-2)"

Search files modified the day before yesterday.

dt ftsearch "name:*anua*"

Search file names containing “anua”, e.g. manuals.

Examples
 (Combined search with Boolean operators AND, OR, and -):
dt ftsearch "colorspace:CMYK AND alpha:0"

Search for CMYK image without alpha channel. (The AND operator can be omitted from the query.)

dt ftsearch "profile:Euro OR profile:SWOP"

Search for images with ICC Profiles “Euro*” or “SWOP*”.

dt ftsearch "colorspace:RGB -kind:JPEG"

Search for images whose colorspace is RGB, but not JPEG images.

Examples
 (More complex queries can be built using parentheses):
dt ftsearch "(colorspace:RGB OR colorspace:CMYK) AND kind:TIFF"

Search for RGB or CMYK TIFF images.

2.6 Advanced Spotlight search syntax

The advanced Spotlight search syntax is used with the -s extension in dt ftsearch. It is the same syntax used on OS X by the “mdfind” command. The advanced Spotlight search offers better control over wildcard searching, e.g. at the beginning of a search term (see Table 2.3).

Value Result
paris* Matches attribute values that begin with “paris”. For example, matches “paris” and “parison”, but not “comparison”.
*paris Matches attribute values that end with “paris”.
Not supported in full-text searches!
*paris* Matches attributes that contain “paris” anywhere within the value. For example, matches “paris”, “parison” and “comparison”.
Not supported in full-text searches!
paris Matches attribute values that are exactly equal to “paris”.

Table 2.3: Advanced Spotlight search – wildcards

Operator Description
== Equal
!= Not equal
< Less than*
> Greater than*
<= Less than or equal*
>= Greater than or equal*
InRange(attributeName,
minValue,maxValue)
Numeric values within the range of minValue through maxValue in the specified attributeName
&& Search term 1 and search term 2
|| Search term 1 or search term 2
! Not search term

Table 2.4: Operators for the advanced Spotlight search syntax

* Available for numeric values and dates only
Time variable Description
$time.now Last five minute's interval
$time.today The current day
$time.yesterday Yesterday
$time.this_week The current week
$time.this_month The current month
$time.this_year The current year
$time.now(NUMBER) Five minute's interval, shifted by adding a positive or negative value to current time (in minutes)
$time.today(NUMBER) A day, shifted by adding a positive or negative value to current day
$time.this_week(NUMBER) A week, shifted by adding a positive or negative value to week
$time.this_month(NUMBER) A month, shifted by adding a positive or negative value to current month
$time.this_year(NUMBER) A year, shifted by adding a positive or negative value to current year
$time.iso(ISO-8601-STR) The date by parsing the specified ISO-8601-STR compliant string

Table 2.5: Advanced Spotlight search – Time variables

Examples:
dt ftsearch -s "kMDItemProfileName == *coated*"

Search for image with a color profile containing the string “coated”.

dt ftsearch -s "InRange(kMDItemPixelWidth,1990,2002)"

Search for images that are between 1990 and 2002 pixels wide.

dt ftsearch -s "kMDItemDisplayName == Summer* && kMDItemColorSpace != CMYK && kMDItemResolutionWidthDPI == 300"

Search for 300 dpi images that are not in the color space CMYK and whose file names start with “Summer”.

dt ftsearch -s 'kMDItemContentModificationDate > "$time.yesterday"'

Search for files that have been modified since yesterday.

dt ftsearch -s 'kMDItemContentModificationDate > "$time.iso(2010-02-12)"'

Search for files that have been modified since February 12, 2010.

Note:

The format for date-related attributes must always be: YYYY-MM-DD or YYYY-MM-DD hh:mm:ss.

Example
 (Windows quoting when using date-related attributes):
dt ftsearch -s "kMDItemContentModificationDate > '$time.yesterday'"

Search for files that have been modified since yesterday.

2.7 Scripting sample for “dt ftsearch” and “dt ftinfo”

Example
 (UNIX only):

Print file name and comment for all pictures with a resolution of less than 300 dpi:

for i in `dt ftsearch -b "dpi:<300"`; do 
	dt ftinfo -k kMDItemPath,kMDItemFinderComment -i $i
	echo
done

HELIOS Website © 2020 HELIOS Software GmbH  
HELIOS Manuals September 10, 2020