UNPKG

spfx-kql-data-retriever

Version:

Search Query Service for retrieve data with Kql with Sharepoint 365

49 lines (48 loc) 1.75 kB
import { IWebPartContext } from '@microsoft/sp-webpart-base'; import { IRefinementFilter, ISearchResults } from './../models/ISearchResult'; import { ISearchService } from './ISearchService'; export declare class SearchService implements ISearchService { static ParseSelectedProperties(value: string): string[]; private _initialSearchResult; private _resultsCount; private _context; private _selectedProperties; private _templateQuery; private _resultSourceId; private _sortList; private _enableQueryRules; resultsCount: number; selectedProperties: string[]; templateQuery: string; resultSourceId: string; sortList: string; enableQueryRules: boolean; private _localPnPSetup; constructor(webPartContext: IWebPartContext); /** * Performs a search query against SharePoint * @param query The search query in KQL format * @return The search results */ search(query: string, refiners?: string, refinementFilters?: IRefinementFilter[], pageNumber?: number): Promise<ISearchResults>; /** * Retrieves search query suggestions * @param query the term to suggest from */ suggest(query: string): Promise<string[]>; /** * Gets the icon corresponding to the file name extension * @param filename The file name (ex: file.pdf) */ private _mapToIcon; /** * Find and eeplace ISO 8601 dates in the string by a friendly value * @param inputValue The string to format */ private _formatDate; /** * Build the refinement condition in FQL format * @param selectedFilters The selected filter array */ private _buildRefinementQueryString; }