Writing a Search Query

Query language is a powerful way to select content by writing search queries based on a number of options. The query is only used for display purposes in a number of Thought Industries widgets.


Use Case Information

If you have a lot of content, or want to highlight particular pieces of content in your catalog, you can use our query language to dynamically determine what content should appear. For example, you can query by tags, custom fields, content types, and other fields available in the Thought Industries platform.

When configured you can control the following:

  • Display default content in Catalogs
  • Exclude content types where necessary
  • Dynamically control content widgets
  • Promote featured content

Writing a Query

In its most simple form, a query will be made up of two pieces. The first is the query type, while the second is the value. An example would be in the form of Type:Value, where "Type" and "Value" would be represented as information from the Thought Industries platform.

A common example is to use tags to dynamically display content. The query could look like this tags:example. In this example, "tags" is the query type to be called and "example" is the value descriptor. The outcome would show only content tagged with "example".

Tip

Values in queries are case sensitive and need to match exactly. For example, if you want a query to use the tag New, putting the value as new in your query will not yield any results. The proper query would be tags:New.

Other conditions can be added to your queries which will impact the results that may appear. Examples of these other conditions are the AND operator, OR operator and the (minus) - operator.

AND OperatorOR Operator- Operator

AND Operator is used to test for two or more queries. All conditions must be met to dynamically display content. An example could look like this Type:Value AND otherType:otherValue.

 

Note

The AND operator and OR operator must be capitalized to be queried. If you do not have all letters in the operator as capitalized it will not work correctly.

Example Queries

These examples of query language are all based on Thought Industries fields. You can search by tags, content types, custom fields, sources, authors and more. Most of the "Values" are customizable by you and your team so we recommend having a planned structure before creating these values.

Note

Custom Content Fields will require you to create custom "Types" and "Values", while the "Types" for majority of other queries are preset by Thought Industries nomenclature.

  1. The most popular way to select content is by tag. To select all content that has an example tag of “Premium Package” you can use the following query:

    tags:"Premium Package"

    Tip

    Quotations will be needed around any Values that contain a space (e.g., tags:"yellow package").

  2. You can write queries for Content Type. This will allow you to create many curated catalogs or featured content widgets and is a great way to promote certain content. For example,
     

    contentType:"Learning Path"

    or

    contentType:videos
  3. Custom Content Fields can also be used to write queries. You will use the dasherized version of the label for the "Type" in the query. This dasherized label is displayed on the list of custom fields. For example,
     

    difficulty:Easy

    or

    recipe-type:Breads
  4. You can also find content by authors and source, if applicable. Authors and Sources are add to your content in catalog settings. For example,

    source:"Adams LLC"

    or

    authors:"Douglas Adams"
  5. Also note, Multiple terms can be grouped together with parentheses to form sub-queries. For example,

    (tags:"Premium Package" OR tags:"Silver Package")

Available Query Locations

The Thought Industries Platform has many locations to use queries. From default settings for all Catalog widgets, to customizing individual widgets, you will be able to use queries to control your user experience with great detail. The following locations allow you to add queries:

  • Catalog Settings
  • Individual Catalog Widget
  • Featured Content Tiles
  • Featured Content Carousel
  • Image Overlay Tiles
  • About Blocks
  • Hero Image Slider
  • Link Lists
  • Navigation Bar Widget
  • Learner Access Widget
  • Navigation Links
Catalog SettingsIndividual Catalog WidgetFeatured Content TilesFeatured Content CarouselImage Overlay TilesAbout BlocksHero Image SliderLink ListsNavigation Bar WidgetLearner Access WidgetNavigation Links

The Catalog settings can found under Courses > Settings > Organization & Display > Catalog section - Advanced.


Find Default Content and click on Write Search Query to add the queries that match your content. The outcome will be a default of what content displays in all catalog widgets, unless configured individually.

Was this article helpful?
1 out of 6 found this helpful

More resources

  • Academy

    Go from beginner to expert with hands-on training

  • Community

    Ask questions, swap ideas, and learn from people like you

  • Developer Docs

    Reference guides and code samples for developers