public virtual PSSearchGetSearchResultsResponse GetSearchResultsUpdate(string resourceGroupName, string workspaceName, string id)
        {
            SearchGetSearchResultsResponse   response       = OperationalInsightsManagementClient.Search.UpdateSearchResults(resourceGroupName, workspaceName, id);
            PSSearchGetSearchResultsResponse searchResponse = new PSSearchGetSearchResultsResponse(response);

            return(searchResponse);
        }
        public virtual PSSearchGetSearchResultsResponse GetSavedSearchResults(string resourceGroupName, string workspaceName, string savedSearchId)
        {
            SearchGetSearchResultsResponse   responses       = OperationalInsightsManagementClient.Search.GetSavedSearchResults(resourceGroupName, workspaceName, savedSearchId);
            PSSearchGetSearchResultsResponse searchResponses = new PSSearchGetSearchResultsResponse(responses);

            return(searchResponses);
        }
        public virtual PSSearchGetSearchResultsResponse GetSearchResults(string resourceGroupName, string workspaceName, PSSearchGetSearchResultsParameters psParameters)
        {
            SearchGetSearchResultsParameters parameters = new SearchGetSearchResultsParameters();

            parameters.Top = psParameters.Top;
            if (psParameters.Highlight != null)
            {
                parameters.Highlight      = new Highlight();
                parameters.Highlight.Pre  = psParameters.Highlight.Pre;
                parameters.Highlight.Post = psParameters.Highlight.Post;
            }
            parameters.Query = psParameters.Query;
            parameters.Start = psParameters.Start;
            parameters.End   = psParameters.End;

            SearchGetSearchResultsResponse   response       = OperationalInsightsManagementClient.Search.GetSearchResults(resourceGroupName, workspaceName, parameters);
            PSSearchGetSearchResultsResponse searchResponse = new PSSearchGetSearchResultsResponse(response);

            return(searchResponse);
        }
Beispiel #4
0
        public virtual PSSearchGetSearchResultsResponse GetSearchResults(string resourceGroupName, string workspaceName, PSSearchGetSearchResultsParameters psParameters)
        {
            SearchParameters parameters = new SearchParameters();

            if (psParameters.Highlight != null)
            {
                parameters.Highlight      = new SearchHighlight();
                parameters.Highlight.Pre  = psParameters.Highlight.Pre;
                parameters.Highlight.Post = psParameters.Highlight.Post;
            }

            parameters.Top   = psParameters.Top == 0 ? 10 : psParameters.Top;
            parameters.Query = psParameters.Query;
            parameters.Start = psParameters.Start;
            parameters.End   = psParameters.End.GetValueOrDefault(DateTime.UtcNow);

            SearchResultsResponse            response       = OperationalInsightsManagementClient.Workspaces.GetSearchResults(resourceGroupName, workspaceName, parameters);
            PSSearchGetSearchResultsResponse searchResponse = new PSSearchGetSearchResultsResponse(response);

            return(searchResponse);
        }