示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="term"></param>
        public void AddUpdateTerm(string term, string language)
        {
            var doc = GetTerm(term) as QuerySuggesterDocument;

            if (doc == null)
            {
                AddTerm(term, language);
            }
            else
            {
                doc.hitcount  = doc.hitcount + 1;
                doc.timestamp = DateTime.Now;
                SrchClient.Post(doc);
            }
        }
        public async Task UploadDocumentsAsync(string projectId, string branchName, IEnumerable <DocumentIndexDto> documentDtos)
        {
            var result = await _searchClient.Post(projectId, branchName, documentDtos);

            if (!result.IsSuccessStatusCode)
            {
                var content = await result.Content.ReadAsStringAsync();

                throw new UpdateSearchIndexException("During updating search index error occurs: " + content);
            }
        }