Creates a new term list given the specified term list data.
Example of the general usage of term lists:
Namespace: Ankiro.SearchServer.Web.ServicesExamples
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; } } }
Assembly: Ankiro.SearchServer.Web (in Ankiro.SearchServer.Web.dll) Version: 1.13.770.19253 (1.13.770.19253)
Syntax
Parameters
- termList
- Type: Ankiro.SearchServer.Data.Language TermListData
Return Value
Type: TermListDataSee Also