ITermListWebService InterfaceAnkiro Enterprise Suite Reference Documentation
The term list services provides management of term lists. Term lists are used for spellchecking in certain scenarios where the thesaurus spellchecking does not apply. For instance, a search field searching only person names should only spellcheck against the specific list of names and not words in general.

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 ITermListWebService

The ITermListWebService type exposes the following members.

Methods

  NameDescription
Public methodAddTermListTerms
Adds a collection of terms to a specified term list. No checks are carried out as to whether terms added are already contained in the term list.
Public methodClearTermListTerms
Removes all registered terms for the specified term list, but does not delete the term list itself.
Public methodCreateTermList
Creates a new term list given the specified term list data.
Examples

Example of the general usage of term lists:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ankiro.Suite.Client.ManagementService;
using Ankiro.SearchServer.Data.Language;
using Ankiro.SearchServer.Data;
using Ankiro.Suite.Client.TermListService;

namespace Ankiro.Suite.Client.LanguageSample
{
    public class CreateTermListSample
    {
        private readonly TermListWebServiceClient _termListService;
        private readonly ManagementWebServiceClient _managementService;

        public CreateTermListSample(
            TermListWebServiceClient termListService,
            ManagementWebServiceClient managementService)
        {
            _termListService = termListService;
            _managementService = managementService;
        }

        public TermListData CreateTermList(string indexName, IEnumerable<string> properties)
        {
            var index = _managementService.GetIndexByName(indexName);
            if (index == null) throw new InvalidOperationException("Index does not exist.");

            // Create a term list in the database. 
            var termList = _termListService.CreateTermList(
                            new TermListData
                            {
                                Name = "CreateTermListSample"
                            });

            // Associate some properties from the specified index with the term list. 
            // This will cause the term list to be populated by index data dynamically. 
            foreach (var property in index.Properties.Where(property => properties.Contains(property.Name)))
            {
                property.TermListSink = termList.Id;
            }
            // Persist the change to the index, marking the selected properties as sources of data for the term list.
            _managementService.UpdateIndex(index);

            // Process documents in the index, populating the term list with words that exist in the index. 
            // This processing may take considerable time...
            termList = _termListService.RebuildTermListFromIndexData(termList.Id);
            Console.WriteLine("Number of words in term list: " + termList.TermCount);
            return termList;
        }
    }
}
Public methodGetAllTermLists
Retrieves information about all term lists that exist in the installation.
Public methodGetTermList
Retrieves information about a term list given a term list id. If the term list does not exist, null is returned.
Public methodGetTermListTerms
Retrieves registered terms for the specified term list. The method supports the retrieval of a set of terms using the offset and count parameters.
Public methodRebuildTermListFromIndexData
Rebuilds the specified term list, by reprocessing distinct terms for associated index(es).
Public methodRemoveTermList
Permanently removes (deletes) the term list with the specified id, along with all terms contained in the term list.
Public methodUpdateTermList
Updates an existing term list.
Top
See Also