ISearchWebService InterfaceAnkiro Enterprise Suite Reference Documentation
ISearchWebService is used as the main entrypoint to search for matching documents in one or more indexes. Search is primarily carried out through the Search method, which interacts with a preconfigured search profile in an installation.
Examples

Example of the general usage of the search service:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ankiro.SearchServer.Data.Search;
using Ankiro.SearchServer.Data.Search.Xml;
using Ankiro.Suite.Client.DocumentService;
using Ankiro.Suite.Client.ManagementService;
using Ankiro.Suite.Client.SearchService;

namespace Ankiro.Suite.Client.SearchSample
{
    class Program
    {
        static void Main(string[] args)
        {
            ClientFactory clientFactory = ClientFactory.CreateBasicHttpClientFactory(new Uri("http://develop.danbolig.ankiro.dk/"));
            SearchWebServiceClient searchService = clientFactory.CreateSearchServiceClient();

            var parameters = new SearchParameters
                                 {
                                     SearchProfileId = 23,
                                     Offset = 0,
                                     MaxResults = 100,
                                     SearchString = "*",
                                     SpellcheckSearchString = true,
                                     LogSearch = false,
                                     LogSearchParameters = false,
                                     Parameters = new Dictionary<string, string>
                                                      {
                                                          { "fields", "AabentHusDato" }, 
                                                      },
                                     ReturnDiagnostics = true,
                                     RefreshCache = true,
                                 };
            parameters.AddParameter("Sort", new Parameter()
                                                {
                                                    Item = new CompoundList()
                                                               {
                                                                   Compound = new Compound[]
                                                                                  {
                                                                                      new Compound()
                                                                                          {
                                                                                              Field = new NamedField[]
                                                                                                          {
                                                                                                              new NamedField("sort-by", "AabentHusDato"),
                                                                                                              new NamedField("sort-by-direction", "ascending")
                                                                                                              ,
                                                                                                          }
                                                                                          }
                                                                                  }
                                                               }
                                                });

            // SearchProfileId must refer to a search profile created through the web interface or through the management service. 
            var result = searchService.Search(parameters);
            Console.WriteLine("Number of results: " + result.TotalResults);

            foreach (var document in result.Documents)
            {
                Console.WriteLine(document.Uri + ": " + document.Properties.Single(x => x.Name == "AabentHusDato").Value);
            }
            Console.ReadKey();
        }
    }
}

Namespace: Ankiro.SearchServer.Web.Services
Assembly: Ankiro.SearchServer.Web (in Ankiro.SearchServer.Web.dll) Version: 1.13.770.19253 (1.13.770.19253)
Syntax

public interface ISearchWebService

The ISearchWebService type exposes the following members.

Methods

  NameDescription
Public methodGetTypeAheadSuggestions
Retrieves type ahead information for a given partial user query. This method is designed to provide data for populating a drop down box when interactively suggesting search terms to an end user. Suggestions are obtained by analyzing previous distinct search phrases that have been logged. No actual search is carried out when invoking GetTypeAheadSuggestions, however an average of previously matched documents for suggested search terms are returned for each type ahead suggestion.
Public methodMarkupText
Performs contextual markup of a text or html string. This method may be used to create dynamic markup of individual pages in a search result based on the search phrase that was active at the time of a search.
Public methodProcessParameters
Note: This method is only relevant if custom parameter processing has been enabled in Ankiro Enterprise Suite. Applies custom parameter processing to the given search parameters without actually performing a search. The returned parameters can be sent to the Search method with DisableCustomParameterProcessing set to true. If no custom processing has been enabled, the parameters will be returned in an unmodified state.
Public methodSearch
Executes a search based on the specified parameters and returns a search result. Please refer to the documentation for the SearchResult and SearchParameters classes for more information.
Public methodTryGetPreviewSearchResult
Retrieves a preview of a search result given a set of preview search parameters. The purpose of a preview search result is to provide an ability to rapidly display a list of search results to a search user, even while the user is typing in the search query. The preview search result subsystem of Ankiro Enterprise Suite uses existing search history to retrieve the first search result page of the search query that is deemed most likely to be relevant to the user given a (partial) search string. Likelihood is determined by search frequency - i.e. the search result that will be returned (if any) will be the most frequently executed search string that contains the entered (partial) preview search string. For performance reasons, no new search will be executed using this method. Instead, null is returned if no suitable search result could be obtained.
Public methodXmlSearch
Executes a legacy XML search. The search parameters connect the query to a search profile, and allows the query to be logged.
Top
See Also