Make SharePoint Search EASY With PnP Modern Search

Sdílet
Vložit
  • čas přidán 12. 09. 2024
  • Microsoft SharePoint PnP modern search filters are just amazing as the vertical web part. Learn how to create this as we build out more of the people directory we started in the last video. PnP Modern Search is amazing to build solutions with, and I highly recommend it.
    🔥 Online Course - PnP Modern Search 101 - courses.stevec...
    ==================================
    🆓 My guides, cheat sheets, and freebies
    ==================================
    shop.stevecore...
    =============================
    🔥 Other Courses
    =============================
    courses.stevec...
    =====================================
    🔥 Get My Newsletter - SharePoint Insights🔥
    =====================================
    sharepointinsi...
    ✅ Connect With Me
    Socials - stevecorey.social
    Web - stevecorey.com
    ✅ Check out part 3 that covers handlebars markup and templates! • Start Mastering ShareP...
    ✅ Check out the full SharePoint playlist - • SharePoint
    ✅ Other Relevant Playlists
    SharePoint Search Configuration - • Sharepoint Search
    SharePoint View/List Formatting - • SharePoint List/View F...
    PnP Modern Search Web Parts - • PnP Modern Search
    ✅ If you'd like to engage me or someone on the Quisitive team for professional services, please email us at ask@quisitive.com
    #sharepoint #search #features

Komentáře • 36

  • @stevecorey365
    @stevecorey365  Před rokem +1

    Check out part 3 that covers handlebars markup and templates! czcams.com/video/3QrAcFgYmro/video.html

  • @KrzysztofKalkowski-b2v
    @KrzysztofKalkowski-b2v Před rokem +1

    I am looking at this and it look great, thank you for the tutorial.
    My question is: is it possible to filter the search results in the way that there will not be users shown for a specific department or if the department field will be empty? Thank you K

    • @stevecorey365
      @stevecorey365  Před rokem +1

      Yes you can! You just need to modify the search query KQL to exclude or limit the department. Empty departments are much harder, because there's no way to query for a value that's empty. You'd have to solve that a different way.

  • @mensrea2686
    @mensrea2686 Před rokem +1

    Steve, this is excellent! Thank you so much, I've been searching for a simple walkthrough on verticals for a while now. quick question: for the query template, you've selected "BaseOfficeLocation" which is a managed property, but is it a managed property that you've created and updated "All" staff memebers country of operations or did you rely on AD to pull the location that was entered while creating users profiles?

    • @stevecorey365
      @stevecorey365  Před rokem +1

      Hi Mens! Thanks so much for the feedback! In my case, I'm using a free M365 developer tenant, and have no on-premise AD to sync to. What I did was manually assign each of my user accounts to a particular location (which is pulling from a term set in the term store). In a production environment, Azure AD Connect would map whichever field is being used on-prem to a field in Azure AD. That would be a simple text field, if I recall, and could be mapped to the same managed property I used, or some other one.

    • @mensrea2686
      @mensrea2686 Před rokem +1

      @@stevecorey365 Thank you, Steve. Appreciate your reply. Great vids keep'em coming 👌 👏 👍🏻

  • @gnaneshwarreddy8558
    @gnaneshwarreddy8558 Před 4 měsíci +1

    Can we create a group to the filters like only one section in filters should be expanded at a time. Due to lot of checkboxes the section height is big and just wanted to collapse the section when other section is expanded. Really appreciate your help. Thank you

    • @stevecorey365
      @stevecorey365  Před 3 měsíci

      Yeah, I think this is possible, but only with custom development. PnP Modern Search does allow for extensibility that way.

  • @vvaassaanntthh
    @vvaassaanntthh Před 2 měsíci

    Hi Steve, great video! loved it.
    Can you advice if its possible to restrict the returned search results based on the country of logged in user? I have scenario where people from two different locales/countries login to this search page. The requirement is that depending on whether the user is from India or Australia , only the documents pertaining to that country should be retrieved in the search results webpart.
    Note: I have already created a site column (in the doc library) as a metadata field named "user country". This column gets tagged with the values (Ind or Aus) based on which of the folders the file is dropped into.

    • @stevecorey365
      @stevecorey365  Před 2 měsíci

      Yes, you should be able to use the search query to require documents to match the user's country (based on a managed property mapped to the user's profile field for country). There may already be a mapped property, to be honest. Otherwise, you'd create a new one.

  • @wbrunoo
    @wbrunoo Před 3 měsíci +1

    I'm trying to use the managed properties to display the users location, but when I enter this information in the configuration, no results are displayed. I tried using 'BaseOfficeLocation' and 'Location', but it doesn't return any information. Is there any configuration or something that can be done to extract this information? Aprreciate your help.

    • @stevecorey365
      @stevecorey365  Před 3 měsíci +1

      I'd make sure you actually have data in the crawled property that you're mapping to. BaseOfficeLocation is mapped to a crawled property. If there's no data in the crawled prop, that can result in what you're seeing.

    • @wbrunoo
      @wbrunoo Před 2 měsíci

      @@stevecorey365 Thanks for the suggestion. How can I check if there is data in the crawled property for BaseOfficeLocation or any other crawled property? And if there is no data, are there any alternatives to resolve this issue?

  • @globalvenues
    @globalvenues Před rokem +1

    Hey Steve. How do you customize the search results template to add accessibility tags to the search results when showing the current page like adding aria-current=”page” to the pagination selected number?

    • @stevecorey365
      @stevecorey365  Před rokem

      There's no way out of the box to add aria tags to the pagination, from what I've seen. PnP Modern Search uses the react-js-pagination library, which doesn't support it. If that's a requirement in your solution, I'd recommend looking into the extensibility framework of PnP Modern Search to add this. You may be able to create a custom pagination component which supports aria tags.

  • @ActionHero29
    @ActionHero29 Před měsícem +1

    I'm trying to return a query to a document library, searching by file name. I having trouble doing that. Thanks for the videos

    • @stevecorey365
      @stevecorey365  Před měsícem

      My pleasure! For a lot of search issues like your, remember to use something like a wildcard (asterisk) to allow partial name matching.

  • @jefinmathew9684
    @jefinmathew9684 Před 2 měsíci

    13:25
    Hi Steve, why is there a total count mismatch before and after connecting vertical webpart to the search result webpart? Total was 21 before connecting to vertical, then after connecting it became 17 !!

    • @stevecorey365
      @stevecorey365  Před 2 měsíci +1

      Typically counts can drop like that if there are missing values. Because the vertical applies a filter on office location (in this case), users without an office location disappear. That's because even if you use a wildcard (*) as the value, as we did in the "All" vertical, SharePoint Search only returns items with some value. A missing value (AKA a null value) doesn't match the wildcard.

    • @jefinmathew9684
      @jefinmathew9684 Před 2 měsíci

      @@stevecorey365 okay, understood. thanks.

  • @mensrea2686
    @mensrea2686 Před rokem

    Sorry to bother you with questions, Steve. But what if I wanted to refine the results so it wont show for examples users with certain words in their names e.g. "Meeting Room" or "Room"? thanks

    • @stevecorey365
      @stevecorey365  Před rokem +1

      You can change the search template in the search results web part to accomplish this. At the end of the template, add these two expressions, which will ensure those results don't get returned (notice there's wildcards to account for a possible room number as well):
      -Title:"Meeting Room*" -Title:"Room*"

    • @mensrea2686
      @mensrea2686 Před rokem +1

      @@stevecorey365 thank you so much, Steve. really appreciate it! I'll try it out today!

  • @mensrea2686
    @mensrea2686 Před rokem

    Hi Again, Steve. I have a managed property called Department that is mapped to Department exactly like your example, however I can't seem to find it under "customize filter" nor under the "Selected Properties" in the Search Results settings. I've tried re-indexing the site with no luck. I've tried adding it to a RefinableString but that didn't work either. any ideas?

    • @mensrea2686
      @mensrea2686 Před rokem

      The JobTitle worked, btw!

    • @stevecorey365
      @stevecorey365  Před rokem

      Once you create a new managed property, you'll need to wait for data to be crawled and populate that property in the index. What I do is go the list/library that has the associated crawled property, change some data on that list (title, etc), change it back, and wait 15min. That's usually enough time for the incremental crawler to grab that new record and index it. At that point, the managed property should show up everywhere you'd expect it to.
      As an alternative, you can go to the last page of the search results web part, and in the import/export config, add the managed property to the Selected Properties you see near the top of the file. That's the quick and dirty method for when I feel impatient :)

  • @cvkealey
    @cvkealey Před rokem

    I have a site content type that contains a lookup column to a list in the same site. I know that Managed Properties are not automatically created for lookup columns, so I manually created one for it. However, it doesn't appear in the list of properties available in the layout. I'm sure I'm missing something simple (like waiting some time for things to "sync up" - I've been struggling with this for a few hours), but it's quite frustrating. Any suggestions or tips?

    • @stevecorey365
      @stevecorey365  Před rokem

      Hey Chad! As long as the managed prop is hooked up to the correct crawled prop (because sometimes multiple crawled props are created), you just need to trigger data to be crawled. If you've got a record with that field populated, make some minor change. Add a space to the title, wait a few seconds, then remove it. That'll cause the Modified date to get updated, and trigger a crawl of that item. Wait 10-15min, and the data should be there in the managed prop. Until data is actually stored in that managed property, I don't think it will show up in the Selected Properties.
      If you're using PnP Modern Search, another shortcut is to go to the last page of the search results web part properties, and in the Import/Export section, add it there. You'll see the managed properties near the top of the code window.

    • @cvkealey
      @cvkealey Před rokem

      @@stevecorey365 thanks...I refreshed the data and it seems like it picked up the managed property. I also noticed that another column in the content type (a multi-line of text column for "description") is appearing in the template, but has a value of "null" for every entry. Is that normal? Also, back to the lookup column, that has values, but I'm trying to connect to it in a Search Filters web part and keep getting "No available filter to display". I've retraced my steps a dozen times and can't see what I'm doing wrong. There are about 700 items in the data source, and that's a multi-select lookup column, so maybe it just won't work the way I want it to.
      EDIT: I found a solution. I had repurposed one of the "refinablestring" properties, and apparently THAT'S the name you need to use when setting up a Filter web part.

    • @stevecorey365
      @stevecorey365  Před rokem

      Description is on all libraries, so that's where you're seeing that. I've never used it, myself. As for the "no available filter to display" issue, if you created a custom managed prop, you can't refine/filter based on it. You need to use one of the refinable properties (like RefinableString102 or similar) based on the data type you're storing.

    • @cvkealey
      @cvkealey Před rokem

      @@stevecorey365 I did sort out the filters thing. I was using the "RefinableString00" property, but trying to connect to it using an alias, which did not work. When I used the direct name, it made the connection. As for the "description", the content type has a specific site column (not using the default "description" one). When I look at the debug template, I see the field name, but it's "null" for every result. I'd really like to display that in a card, so I'm going to dig into learning handlebar templates today. If that falls through, I might go the adaptive cards route. I just wish it were more like styling gallery views of a list (which still isn't "easy", but more familiar to me).

  • @user-bv2vr9wq1b
    @user-bv2vr9wq1b Před 10 měsíci

    I for the life of me cannot get Office Location to work for the filter or for the verticals.

    • @stevecorey365
      @stevecorey365  Před 10 měsíci

      They can be tough to troubleshoot sometimes, but make sure you're using a refinable managed property. That trips up a lot of people.

  • @pavank2750
    @pavank2750 Před rokem +1

    Please provide me amy poc document?

    • @stevecorey365
      @stevecorey365  Před rokem

      I don't have any documentation for the POC, as the video serves that purpose. I do intend to make my code available to our community, so stay tuned for that!