+

Search Tips   |   Advanced Search

Add query parameters


We can add query parameters as required using the following instructions.


Sorting the results

Use the query parameters orderMetric and order to sort entries of a result set.

Example:

tm:ts:all&orderMetric=TAG_SPACE_COUNT_NAME&order=ASC
This returns a feecontaining all available tag spaceso that is all available tags and their names and counts. The results are sorted in ascending order, first by tag count, and, if counts are equal, by tags name.


Limiting the results

We can use the query parameters start-index and max-results to limit the query results in the feed to a subset.

Examples:

  1. uri=tos:typeahead&term=A&max-results=10
    
    This example returns a feecontaining at the most the first 10 elements of the result.

  2. uri=tos:typeahead&term=A&start-index=20&max-results=10
    
    This example returns a feecontaining at the most 10 elements, starting with the 20th element from the result.

  3. tm:name:tag_name&start-index=5&max-results=5
    
    This example returns a feecontaining 5 tag entries of the overall result sethat match the name tag_name, leaving out the first four results, and returning the following 5 tag entries.


Use scopes

Users can apply both tags and ratings as community tags or personal tags, either public or private. For details refer to the topic about how tagging and rating works in the portal. To control whether you query only community or personal tags or ratings, or both types of tags or ratings, use the parameter scope. Valid values are as follows:

Example:

tm:ts:all&scope=COMMUNITY&scope=PERSONAL_PUBLIC 
This returns a feecontaining all available tag spaces with community tags and the public tags of the current user.


Locale sensitive queries

We can specify to search only a specific locale or set of locales. This can be useful when you work with URIs that address tags by their name locales. To do this, use the parameter locale. Examples:

tm:name:tag_name&locale=de
This returns a feecontaining all tags that match the name tag_name in the locale de.
tm:name:tag_name&locale=de&locale=en
This returns a feecontaining all tags that match the name tag_name in the locale de or en.


Parent: The REST API
Related reference:
How tagging and rating works in the portal