Search query API
2012-04-25Searching with the new SiteSeeker .NET API has been made very simple and we will continue to develop the API to ensure that you will have the best search experience possible while using the API.
This article describes the search API and some of the most common search patterns.
The .NET Search API
The Search API can be seen through the class SearchIndex which exposes methods to search with, namely:
public SearchResponse Search(string searchPageName, string userQuery, params SearchRequest[] searchRequests)
searchPageName | The search page name this query originates from |
userQuery | The user query specified from the input from user |
searchRequests | The search requests for this query |
In order for your statistics to make sense, you will need to specify the page or area that you are searching from. It is a logical name which will be utilised in your stastistics.
The user query is the query that the end user has specified. Note that you can as a developer specify your own search query in the static query property of the search request.
The searchRequests
parameter is an optional parameter. In most instances, you will want to control the search more than just relying on the user input. You can create a searchRequest
object and set the properties as you see fit e.g the static query field.
You will be able to conduct multiple search requests at the same time, and therefore the API allows for multiple searchRequest
objects to be passed in.