Advanced Search Guide

This document describes the use of the Imagen search syntax to produce advanced search queries.

This syntax can be used to produce advanced search results, utilising the copious metadata stored against each media record.

The aforesaid search can then be used by users with the appropriate permissions to create an MRSS feed to be embedded on websites, in readers etc

All items

The simplest search is to simply show all records that the user has access to. This requires a wildcard (*) only in the search field.

Wildcards

The same wild card can be used as a placeholder for one or more characters. So, if the user wished to search for all players whose names sounded like ‘Johnson’, but were
not sure of the spelling, they could search for Jo*s*n.

Sorting

All searches will sort by publish date descending by default (newest first). Should users wish to resort, the 'Sort by' dropdown box at the top of the filter and sort panel to the left of the results page will allow a number of alternative sorting options.

Using Quotation marks

Quotation marks can be used in two ways. Firstly to search for a phrase e.g. "Magic Johnson", and secondly to surround a value to search for in a specific field (see below for more information).  

If users do not use quotation marks around their search query, e.g. Magic Johnson, the search will search for each word in the searched for string.  The above search would therefore return every record pertaining to Magic and every records pertaining to Johnson.

Searching by Field

For each searchable field (of which there are a total of over 100), there is a ‘friendly’ or ‘familiar name’ by which users are most likely to refer to that field, and the case sensitive database-friendly field name. When searching using specific fields, users should always use the database-friendly field name. Some examples of the most likely fields to be
used are shown in the table below.

Please note that the 'pubDate' field cannot be searched using just a date field.  It is necessary to search for the precise time, using ISO 8601 format (i.e. with a T between the date and time and a Z at the end of the time). Because for the most part the exact time to the second will not be known, searching by  pubDate is best done with a date range as below, which searches for a pubDate of 30th September 2019.

NBA friendly name Database friendly field name (Key) Example Value
Package taxonomyCodeName "NBA Daily Archive"
Team NBATeamName "Philadelphia 76ers"
Player NBAPlayerName "Amir Johnson"
Coach NBAPlayerName "Lonnie Walker"
League NBALeagueCodeName "NBA"
Content type type "Video" / "Articles"
Source sourceName "NBA Team News"
Published Date pubDate [2019-09-30T00:00:00Z TO 2019-10-01T00:00:00Z]
City locationCityName "Phoenix"
Country locationCountryName "United States"
Creation date NBADateCreated "2018-04-11"
Item ID NBAguid "201804112050NBA_____VIDEOS__N …"

To perform this kind of search, the basic syntax of the search is as follows:

Database field name :"value to search for"

The colon and the quotation marks are essential to indicate the different parts of the search. For example, to find all records relating to the Philadelphia 76ers, you would therefore build the search text as follows:

NBATeamName:"Philadelphia 76ers"

Multiple combinations of fields, together with the AND, OR and NOT operators, can allow users to build up more complex search queries.

Caution

When composing a new search query, take care not to include spaces except where absolutely required. For example, a search for type: Video will search for " Video" in the type field, and is likely to return no results. If users do not see the results that they expected, check for extraneous spaces after colons or at the end of search strings. Users should be aware that quotation marks can encode quite differently according to their style and source.

‘Curly’ or 'Smart' quotation marks such as tend to be produced automatically in many Microsoft Office programs will not be recognised as encapsulating a search string, but will be searched for as part of the query. Try to ensure that quotation marks are clearly straight and unstyled. There is a setting in Microsoft Word that can be unticked to prevent the automatic replacement of straight quotation marks with smart quotation marks.

Case sensitivity is another area to watch. Field names in particular will tend to be case sensitive. If a user is getting unexpected results, or no results where some may be anticipated, check the case of the field name(s), as well as the searched for string.

Dates

You can always refine your searches by date, and change the sorting using the filter panel to the left of the results page.  However, if you wish to limit your search to, say, "today", you can use some special shorthand:

NOW means precisely now, this very millisecond - in reality it's unlikely to match very much, but it can be used in some quite creative ways.

NOW/DAY means today, the slash rounds the precise time back to 12am on that day

NOW-2DAY would mean the time from precisely now - 2 days.

Similarly, NOW-1MONTH means the time precisely 1 month ago and NOW-1YEAR means the time precisely one year ago

NOW-2DAY/DAY would therefore mean 12am two days ago.

This is perhaps more useful as part of a date range. To use this in a date range, encapsulate the range within square brackets:

[NOW-2DAY TO NOW] would give you any time within the past 48 hours exactly.

[NOW-2DAY/DAY TO NOW] would give you any time from 12am 2 days ago to now exactly

[NOW-7DAY/DAY TO NOW/DAY] would give you anything over the past full week, for example pubDate:[NOW-7DAY/DAY TO NOW/DAY].

[NOW-1MONTH/DAY TO NOW/DAY] would give you anything over the past month, while [NOW-1YEAR/DAY TO NOW/DAY] will give you anything over the past year.

Search Syntax:

Select all *
General search search string e.g. Mad Ants
Basic filter Key:"Value" e.g.taxonomyCodeName:"NBA Daily Archive"
Operators AND / OR / NOT

e.g. Mad Ants NOT Jared

Combining Operators A AND B will produce everything that is both A and B

A OR B will produce everything that is either A or B

NOT A AND B will produce everything that is both NOT A and at the same time B

NOT A AND NOT B will produce everything that is both NOT A and at the same time NOT B

Exclusion search NOT search string
Combined Exclusion search NOT search string Key:"Value"

e.g. Mad Ants NOT type:"Social"

For more guidance on combining operators, see the Venn diagrams below:

A AND B

https://assets.nba.com/storage/v1/file/0x060a2b340101010201010f12133853a22be8600224860580df78000D3A1B83A6

A OR B

NOT A AND B

NOT A AND NOT B / NOT (A OR B)

NOT (A AND B)