/// <summary>
        /// Fetches statistics about the search result items.
        /// </summary>
        public async Task <SearchStatistic> GetStatisticsAsync(Guid searchId)
        {
            var parameters = new Dictionary <string, object>
            {
                { "id", searchId }
            };

            return(await IXAPI.GetAsync <SearchStatistic>(_context,
                                                          "/intelligent/search/statistic", parameters).ConfigureAwait(false));
        }
        /// <summary>
        /// Fetches statistics about the search result items.
        /// </summary>
        public Task <SearchStatistic> GetStatisticsAsync(Guid searchId, CancellationToken cancellationToken = default)
        {
            var parameters = new Dictionary <string, object>
            {
                { "id", searchId }
            };

            return(IXAPI.GetAsync <SearchStatistic>(_context,
                                                    "/intelligent/search/statistic", parameters, cancellationToken: cancellationToken));
        }
Example #3
0
        public async Task <XScoreExplanation> ExplainXScoreAsync(Guid systemId, string bucket)
        {
            var parameters = new Dictionary <string, object>
            {
                { "id", systemId },
                { "bucket", bucket }
            };

            return(await IXAPI.GetAsync <XScoreExplanation>(_context,
                                                            "/item/explain/xscore", parameters).ConfigureAwait(false));
        }
Example #4
0
        public Task <XScoreExplanation> ExplainXScoreAsync(Guid systemId, string bucket, CancellationToken cancellationToken = default)
        {
            var parameters = new Dictionary <string, object>
            {
                { "id", systemId },
                { "bucket", bucket }
            };

            return(IXAPI.GetAsync <XScoreExplanation>(_context,
                                                      "/item/explain/xscore", parameters, cancellationToken: cancellationToken));
        }
Example #5
0
        public async Task <byte[]> ReadAsync(string storageId, string?bucket = default)
        {
            const int OUTPUT_TYPE_RAW_BINARY = 0;

            var parameters = new Dictionary <string, object>
            {
                { "type", OUTPUT_TYPE_RAW_BINARY },
                { "storageid", storageId },
                { "bucket", bucket ?? string.Empty }
            };

            return(await IXAPI.GetAsync <byte[]>(_context, "/file/read", parameters).ConfigureAwait(false));
        }
Example #6
0
        public async Task <IEnumerable <Selector> > ListSelectorsAsync(Guid systemId, string bucket)
        {
            var parameters = new Dictionary <string, object>
            {
                { "id", systemId },
                { "bucket", bucket }
            };

            var response = await IXAPI.GetAsync <ListSelectorsResponse>(_context,
                                                                        "/item/selector/list/human", parameters).ConfigureAwait(false);

            return(response.Selectors);
        }
Example #7
0
        public Task <byte[]> ReadAsync(string storageId, string?bucket = default, CancellationToken cancellationToken = default)
        {
            const int OUTPUT_TYPE_RAW_BINARY = 0;

            var parameters = new Dictionary <string, object>
            {
                { "type", OUTPUT_TYPE_RAW_BINARY },
                { "storageid", storageId },
                { "bucket", bucket ?? string.Empty }
            };

            return(IXAPI.GetAsync <byte[]>(_context, "/file/read", parameters, cancellationToken: cancellationToken));
        }
        public override async Task <(SearchResultStatus, IEnumerable <PhoneBookSelector>)> FetchResultsAsync(Guid searchId, int offset = 0, int limit = 100, CancellationToken cancellationToken = default)
        {
            var parameters = new Dictionary <string, object>
            {
                { "id", searchId },
                { "offset", offset },
                { "limit", limit }
            };

            var response = await IXAPI.GetAsync <PhoneBookSearchResults>(_context,
                                                                         _apiPathSegment + "/search/result", parameters, cancellationToken : cancellationToken).ConfigureAwait(false);

            return(response.Status, response.Selectors);
        }
        public override async Task <(SearchResultStatus, IEnumerable <Item>)> FetchResultsAsync(Guid searchId, int offset = 0, int limit = 100)
        {
            var parameters = new Dictionary <string, object>
            {
                { "id", searchId },
                { "offset", offset },
                { "limit", limit }
            };

            var response = await IXAPI.GetAsync <IntelligentSearchResults>(_context,
                                                                           _apiPathSegment + "/search/result", parameters).ConfigureAwait(false);

            return(response.Status, response.Records);
        }
Example #10
0
        public async Task <byte[]> ViewAsync(
            string storageId,
            string bucket,
            ViewFormat format = ViewFormat.Text,
            bool escapeHtml   = true)
        {
            var parameters = new Dictionary <string, object>
            {
                { "f", format },
                { "storageid", storageId },
                { "bucket", bucket },
                { "escape", escapeHtml ? 1 : 0 }
            };

            return(await IXAPI.GetAsync <byte[]>(_context, "/file/view", parameters).ConfigureAwait(false));
        }
Example #11
0
        public Task <byte[]> ViewAsync(
            string storageId,
            string bucket,
            ViewFormat format = ViewFormat.Text,
            bool escapeHtml   = true,
            CancellationToken cancellationToken = default)
        {
            var parameters = new Dictionary <string, object>
            {
                { "f", format },
                { "storageid", storageId },
                { "bucket", bucket },
                { "escape", escapeHtml ? 1 : 0 }
            };

            return(IXAPI.GetAsync <byte[]>(_context, "/file/view", parameters, cancellationToken: cancellationToken));
        }
Example #12
0
        public async Task <byte[]> PreviewAsync(
            string storageId,
            DataType dataType,
            MediaType mediaType,
            string bucket,
            int lineCount   = 12,
            bool escapeHtml = true)
        {
            var parameters = new Dictionary <string, object>
            {
                { "sid", storageId },
                { "b", bucket },
                { "l", lineCount },
                { "f", mediaType == MediaType.Picture ? 1 : 0 },
                { "c", dataType },
                { "m", mediaType },
                { "e", escapeHtml ? 1 : 0 }
            };

            return(await IXAPI.GetAsync <byte[]>(_context, "/file/preview", parameters).ConfigureAwait(false));
        }
Example #13
0
        public Task <byte[]> PreviewAsync(
            string storageId,
            DataType dataType,
            MediaType mediaType,
            string bucket,
            int lineCount   = 12,
            bool escapeHtml = true,
            CancellationToken cancellationToken = default)
        {
            var parameters = new Dictionary <string, object>
            {
                { "sid", storageId },
                { "b", bucket },
                { "l", lineCount },
                { "f", mediaType == MediaType.Picture ? 1 : 0 },
                { "c", dataType },
                { "m", mediaType },
                { "e", escapeHtml ? 1 : 0 }
            };

            return(IXAPI.GetAsync <byte[]>(_context, "/file/preview", parameters, cancellationToken: cancellationToken));
        }
Example #14
0
 /// <summary>
 /// Terminates the search job, no-op if the search was already terminated.
 /// </summary>
 /// <param name="searchId">The identifier of search to be terminated.</param>
 public Task TerminateAsync(Guid searchId, CancellationToken cancellationToken = default)
 {
     return(IXAPI.GetAsync <string>(_context, "/intelligent/search/terminate?id=" + searchId, cancellationToken: cancellationToken));
 }