diff --git a/samples/react-search-refiners/README.md b/samples/react-search-refiners/README.md index d0651a904..e4d8579aa 100644 --- a/samples/react-search-refiners/README.md +++ b/samples/react-search-refiners/README.md @@ -7,8 +7,10 @@ This sample shows you how to build user friendly SharePoint search experiences u
+An associated [blog post](http://thecollaborationcorner.com/2017/10/16/build-dynamic-sharepoint-search-experiences-with-refiners-and-paging-with-spfx-office-ui-fabric-and-pnp-js-library/) is available to give you more details about this sample implementation. + ## Used SharePoint Framework Version -![drop](https://img.shields.io/badge/drop-1.3.0-green.svg) +![drop](https://img.shields.io/badge/drop-1.3.4-green.svg) ## Applies to @@ -25,7 +27,7 @@ react-search-refiners | Franck Cornu (MVP Office Development at aequos) - Twitte Version|Date|Comments -------|----|-------- -1.0 | October 17, 2017 | Initial release +1.0 | January 03, 2018 | Initial release ## Disclaimer **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** @@ -49,7 +51,8 @@ The following settings are available in the Web Part property pane: Setting | Description -------|---- -Search query | The search query in KQL format. You can use search query variables (See this [post](http://www.techmikael.com/2015/07/sharepoint-rest-do-support-query.html) to know which ones are allowed). +Search query keywords | The search query in KQL format. You can use search query variables (See this [post](http://www.techmikael.com/2015/07/sharepoint-rest-do-support-query.html) to know which ones are allowed). +Query template | The search query template in KQL format. You can use search variables here (like Path:{Site}). Selected properties | The search managed properties to retrieve. You can use these proeprties then in the code like this (`item.property_name`). (See the *Tile.tsx* file) . Refiners | The search managed properties to use as refiners. Make sure these are refinable. With SharePoint Online, you have to reuse the default ones to do so (RefinableStringXX etc.). The order is the same as they will appear in the refnement panel. Number of items to retrieve per page | Quite explicit. The paging behavior is done directly by the search API (See the *SearchDataProvider.ts* file), not by the code on post-render. diff --git a/samples/react-search-refiners/config/package-solution.json b/samples/react-search-refiners/config/package-solution.json index 85f5d24f4..1e6561116 100644 --- a/samples/react-search-refiners/config/package-solution.json +++ b/samples/react-search-refiners/config/package-solution.json @@ -3,7 +3,7 @@ "solution": { "name": "PnP - Search and Refiners Web Part", "id": "890affef-33e0-4d72-bd72-36399e02143b", - "version": "1.0.0.1" + "version": "1.0.0.0" }, "paths": { "zippedPackage": "solution/pnp-react-search-refiners.sppkg" diff --git a/samples/react-search-refiners/images/property_pane.png b/samples/react-search-refiners/images/property_pane.png index 6a168578a..3e1d4b3ef 100644 Binary files a/samples/react-search-refiners/images/property_pane.png and b/samples/react-search-refiners/images/property_pane.png differ diff --git a/samples/react-search-refiners/images/react-search-refiners.gif b/samples/react-search-refiners/images/react-search-refiners.gif index 6bdeded9d..60ec26953 100644 Binary files a/samples/react-search-refiners/images/react-search-refiners.gif and b/samples/react-search-refiners/images/react-search-refiners.gif differ diff --git a/samples/react-search-refiners/package.json b/samples/react-search-refiners/package.json index 2265e13b6..8cee1642b 100644 --- a/samples/react-search-refiners/package.json +++ b/samples/react-search-refiners/package.json @@ -11,11 +11,11 @@ "test": "gulp test" }, "dependencies": { - "@microsoft/sp-core-library": "~1.3.0", - "@microsoft/sp-lodash-subset": "~1.3.0", - "@microsoft/sp-webpart-base": "~1.3.0", - "@pnp/spfx-controls-react": "^1.0.0-beta.6", - "@pnp/spfx-property-controls": "1.0.0-beta.2", + "@microsoft/sp-core-library": "~1.3.4", + "@microsoft/sp-lodash-subset": "~1.3.4", + "@microsoft/sp-webpart-base": "~1.3.4", + "@pnp/spfx-controls-react": "^1.0.0-beta.8", + "@pnp/spfx-property-controls": "1.0.0", "@types/react": "15.0.38", "@types/react-addons-shallow-compare": "0.14.17", "@types/react-addons-test-utils": "0.14.15", @@ -30,12 +30,12 @@ "react-custom-scrollbars": "4.1.2", "react-dom": "15.4.2", "react-js-pagination": "3.0.0", - "sp-pnp-js": "3.0.1" + "sp-pnp-js": "3.0.3" }, "devDependencies": { - "@microsoft/sp-build-web": "~1.3.0", - "@microsoft/sp-module-interfaces": "~1.3.0", - "@microsoft/sp-webpart-workbench": "~1.3.0", + "@microsoft/sp-build-web": "~1.3.4", + "@microsoft/sp-module-interfaces": "~1.3.4", + "@microsoft/sp-webpart-workbench": "~1.3.4", "gulp": "~3.9.1", "@types/chai": ">=3.4.34 <3.6.0", "@types/mocha": ">=2.2.33 <2.6.0" diff --git a/samples/react-search-refiners/src/webparts/dataProviders/ISearchDataProvider.ts b/samples/react-search-refiners/src/webparts/dataProviders/ISearchDataProvider.ts index 93bdcea66..3399c2f07 100644 --- a/samples/react-search-refiners/src/webparts/dataProviders/ISearchDataProvider.ts +++ b/samples/react-search-refiners/src/webparts/dataProviders/ISearchDataProvider.ts @@ -3,15 +3,26 @@ import { ISearchResults, IRefinementFilter } from "../models/ISearchResult"; interface ISearchDataProvider { /** - * Determines the number of items ot retrieve in search REST requests + * Determines the number of items ot retrieve in REST requests */ resultsCount: number; + + /** + * Selected managed properties to retrieve when a search query is performed + */ selectedProperties: string[]; + + /** + * Determines the query template to apply in REST requests + */ + queryTemplate?: string; /** - * Performs a SharePoint search query + * Perfoms a search query. + * @returns ISearchResults object. Use the "RelevantResults" property to acces results proeprties (returned as key/value pair object => item.[