Filtering - creating and managing queries

This section describes the intermediate step between defining the system feed collection.

For further details, see Defining the system feed collection and deploying the News Query web part.

The administrator-defined system feeds can be queried in a variety of ways to display articles matching a particular theme, and/or from a particular set of system feeds. While the display of a query’s matching results is done via an instance of the News Query web part, definition of the queries available in this web part is done separately on the Manage Query page. This central UI allows the adding and editing of all queries available to the News Query web part.

To get to the Manage Query page, you must have the Manage Feeds permission. For further details, see the Specifying News Stream Administrators.

You then have two options for navigating there:

  • Go directly to the link http://<host>/_layouts/ng/nm/ManageQuery.aspx.
  • Select the News Stream Administration link at the bottom of your Welcome menu. And then select the Manage Query link on the News Stream Management page.

Select the News Stream Administration link

Click Manage Query

The following is an example of what the Query Management page looks like with some queries already defined:

Query Management page

Click a query name to display it for editing. Click the Add button to open a dialog to create a new query. Below is the query creation screen with a new query in progress.

query creation screen

The query should have a descriptive name for users to select in the web part. The query can either search against the content of the articles or the tags on the articles. The query itself can be quite complex – the Boolean operators and, or, not, and near are supported along with grouping via parentheses (see examples below). By default, the query searches all the feeds.

However, specific feeds can be chosen to make the results even more precise. If this is done, only articles from those feeds which match the selected criteria are displayed.

Finally, it is possible to simply select the All option for a set of one or more feeds and not specify any search. In this case, all the articles from the selected feed(s) are included in the query results.

Below are some example queries which are supported followed by how these are interpreted by SQL Full Text Search

  • "cars trucks", "cars & trucks"
  • "cars and trucks", "cars & trucks"
  • "cars near trucks", "cars ~ trucks"
  • "cars&trucks", "cars & trucks"
  • "cars or trucks", "cars | trucks"
  • "cars |trucks", "cars | trucks"
  • "cars!trucks", "cars &! trucks"
  • "cars+trucks", "cars & trucks" //plus is same as AND
  • "cars- trucks", "cars &! trucks" //minus is same as NOT
  • "cars and not trucks", "cars &! trucks"
  • "joomla, iphone, apple, adobe, open source", "joomla & iphone & apple & adobe & open & source"
  • "(cars or trucks) not convertibles", "(cars | trucks) &! convertibles"
  • "401(k)", "401 & (k)"
  • "(cars or trucks) and not convertibles", "(cars | trucks) &! convertibles"
  • "(cars and trucks) not (motorcycles or bikes)", "(cars & trucks) &! (motorcycles | bikes)"