Aug 16 2022 01:18 PM - edited Aug 16 2022 01:19 PM
Aug 16 2022 01:18 PM - edited Aug 16 2022 01:19 PM
Our communications director would like to create site pages for newsletters, which is fine, but we also need to keep an archive of them, displayed on a page. I am using the Highlight web part grid view to display the top few and then the Highlight list view to display the rest. If I were able to use the document library web part, I could set up a view with sorting and grouping, but because they are site pages I have very limited controls. Is there a better way of displaying a listing of site pages within a page?
Here are the only filtering, sorting and grouping controls the Highlight web part offers (far less than a doc library view):
Aug 17 2022 05:34 AMSolution
the control and setting in the highlighted content web part are limited.
For a fully customized web part view, i recommend the PnP Modern Search Web Parts. In there, you can customize the query, sort and visualization from your web parts.
Here are more information: https://microsoft-search.github.io/pnp-modern-search/
Aug 18 2022 12:42 PM
Aug 18 2022 09:51 PM
good to hear. You have more guidance in the scenario tutorial: https://microsoft-search.github.io/pnp-modern-search/scenarios/
When it not help, come back here, we will try to help you ;)
Sep 01 2022 11:50 AM - edited Sep 01 2022 11:54 AM
@David Mehr I am struggling a bit right off the bat. I have an existing "Category" column in my Site Pages. I only want PnP Search to display a list of pages with a specific category. In the second scenario it says that in order for anything to be filtered by the search, it must be a managed property. The column was originally just created by clicking "Add New", not going to Site Columns and clicking "Create", as stated in the instructions. So it seems that I need to create a new column as per the instructions and then go through and set that column to match the values of my original column. Is that correct?
It seems strange to me that columns created in the usual manner aren't available to search, because they're not considered Managed Properties. Am I missing something?
Sep 01 2022 11:16 PM
every column, site and list, will be crawled as "Crawled Property", but only site columns will be automatically added to "Managed Properties". For your list column a Crawled Property is created, but not a Managed Property.
If necessary, you can set the managed properties so that the properties are available as a refinement, can be used in the queries, etc.
In your case
Map your list column to an existing RefinableStringXX property, after that you can use your mapped RefinableStringXX in your search. In the default RefinableStringXX properies are the settings active, to use it in search scenarios.
1. use site columns - with a unique prefix, and withoud spaces or special characters
2. use sharepoint search admin center for search administrations (it's also possible to do it on site level, but in big environments it can become confusing)
Hope this helps.
Sep 02 2022 08:31 AM - edited Sep 02 2022 08:32 AM
Thanks, Dave. I didn't understand that I had to map it to a RefinableStringXX property in order for it to work with PnP search.
Is there a way for columns that were added directly in a doc library or list to become site columns, and then managed properties? I am surprised that if a user adds a column to a list or library there's not an easy way to get that to work with PnP Search. I am assuming I'd need to go into Site Columns, create it there and then follow the steps. I'd then have to migrate the existing user-created column's data to the new managed column. Is that correct?
Sep 02 2022 12:59 PM
i don't know a process for list columns to become automatically a managed property.
In practice you need a SharePoint governance. When you like documents or items from different sites or libraries in one search, you need to use the content type hub to rollout the same column on different places....or create site columns, as admin.
When nobody should be create columns, do not give permissions to others for that, only contribute, but not edit permission. With that users can manage content, but not new columns
Here are more about permission levels: https://docs.microsoft.com/en-us/sharepoint/understanding-permission-levels?source=recommendations
When you like, that users can create their own lists and columns, give them a training and define a governance, what they can do and when they need to use company terms from the tenant level term store.
Sep 02 2022 01:25 PM
Sep 12 2022 02:03 PM
@David Mehr I would like the PnP search results web part to display all items in Site Pages with a certain managed property, unless a value is entered in the PnP search box, then I'd like those results to be displayed (still filtered by the managed property). I think of it like the default search field would be a wildcard unless another value is entered. Is that possible?
Sep 14 2022 04:58 AM
i'm not sure i understand you correctly, but i try...
I have configured the Refinement filters in the search results web part, i will only show elements with RefinableString00 is MWCP.
My Query in Refinement filters: RefinableString00:equals("MWCP")
After that configuration, the filters is set to Event MWCP, it's mapped to RefinableString00 in my environment, but you can also enter your search terms into the Search Box. The results web part will use MWCP and your Serach terms:
Is that, what you looking for?
Sep 20 2022 02:32 PM - edited Sep 20 2022 02:33 PM
Thanks @David Mehr. I had found a different way to go about it, without using the PnP search filters web part. The reason I did this is because it's such a limited search already that there's really no need to filter further. On the first page of the search results, I specified the search terms from the search bar and my refinement filters.
On the third page, I entered a default value of "*".
This seems to work well, other than it does show results for "*" at the top.
Thanks again for your help!
Oct 17 2022 08:00 AM - edited Oct 17 2022 08:02 AM
@David Mehr, I have this working pretty well, but I'm running into an issue that might be a limitation.
There is a repository of site pages that I need to display in the order of a date field, "Date Published", which I created and made a managed property. (I can't sort by the built-in date created or modified fields, or I would have just used the highlighted content web part.)
I can't seem to get PnP Search Results to sort by that field. I can see the field, "DatePublishedOWSDATE", in the list of fields to filter, but it doesn't display in the list of fields for sorting. I've tried to manually enter it in, including the managed property it's mapped to, "RefinableDate00", but that gives an error.
Is there some special way to get it to sort by a managed property date field? Or is sorting only limited to RefinableString fields? If so, how can I sort by a custom date field? Basically, the page is a copy of the contents of a weekly newsletter, so the "Date Published" field is when the content was originally sent out, not when the page was created.
Oct 18 2022 12:53 AM
i have created a custom date field in the page library:
And mapped to the RefinableDate00, it's not possible to create your own date managed property, you need to map it to a default:
In my result web part (PnP Serach 4.8.0 Beta ;) ) i have configured the sort field, i have typed it manual and saved it:
Also i have added the property as column for the visualization:
It works fine with this configuration and i can sort to the custom date field.
As special way you can try to create a result source and sort by your custom field. Then use your result source in to your result web part.
Beste regards, Dave
Oct 19 2022 02:30 PM
Oct 20 2022 02:55 AM
ok, I am confident that you will succeed :flexed_biceps:
Yes, use the same name and the solution will be updated. Best way is to do your procedure on a test tenant.
Show up property in search results
As first you need to add your new property to the selected properties (PnP - Search Results Web Part on page 1) and press enter:
After that you can choose and add your new property under managed columns (PnP - Search Results Web Part on page 2):
Hope this helps.
Oct 20 2022 12:03 PM
Thanks, @David Mehr. Oh how I wish I had a test tenant here :crying_face:. Unfortunately PnP Search is currently broken for me. Opened a GitHub issue: Failed to load component "544c1372-42df-47c3-94d6-017428cd2baf" (pnpSearchResultsWebPart) - The file...
Oct 20 2022 10:51 PM
More Information :backhand_index_pointing_right: https://www.solutions2share.com/create-an-office-365-test-tenant/
Oct 24 2022 08:26 AM - edited Oct 24 2022 08:27 AM
@David Mehr, thankfully my PnP Search Results CDN issue resolved itself over the weekend . The sorting issue also sorted itself out! I really am not sure what resolved it, other than possibly the upgrade to 4.8 (which really was deleting 4.7 and installing 4.8). Both the original managed property and the new one I created can be used to sort the results, so at least it's nice to know that I didn't make some kind of mistake the first time.
That's good to know that I could create my own test tenant pretty easily, though I assume I'd need to use my personal Microsoft account, as it would be frowned upon by my employer. Too bad I would only be able to use it for 90 days (for free).
What exactly would I be able to do with https://cdx.transform.microsoft.com? When I click the link I'm told my account doesn't have the appropriate access level.