Question on pnp search in sharepoint

Copper Contributor

Hi Guys,

I  need some advice with an issue I am facing when setting up PNP Search.

 

I have a SharePoint Document library that has :
-Default columns such as TITLE, Modified etc.

-A New "choice" column I created named "Document type"

The purpose behind creating above new column is to automatically be populated with values (Internal or External) Depending on whether the document is dropped into the "internal" or "External" folder in this library. So I have configured this default value setting in the library. So this metadata column is auto tagged with either of these values based on where document is put.

I have then configured a site page (in this site) which is basically a document hub. The purpose of this page is to have pnp search results, pnp search box and pnp search filter webparts.  

I am trying to get the "document type" column to show up in the pnp search results webpart (and also the filter webpart).  But I am unable to get it to show up. It only shows the default columns available in that library.  I tried to edit this webpart and add the column but unable to get it to show.

 

Any help would be appreciated. 

 

4 Replies

hi @vassp1980 ,

to make a column ready for use in search, you should create it as a Site Column. If you have already created a column and do not want to change it, you can assign the crawled property of this column to one of the predefined managed properties, such as 'RefinableStringxx'.

 

Here is an interesting article on this topic:

https://learn.microsoft.com/en-us/microsoft-365/community/how-do-site-columns-become-managed-propert... 

@michalkornet 

Hello mate,
Thanks so much for the information.
I did follow the link you sent me. I did create a column as a "site column" and named it "SCDocumentType" . I then got it available in the Library view as a column.
image001.png

I then got the auto tagging of this column working as well. However, when I go to Admin centre > crawled properties, I still cant find this field as a "crawled property" even after hours creating the column. 
image002 (1).png

 

Just in case, I did go to the pnp search result webpart, and I can't find it (expected, bcoz it isnt showing up as a crawled property, and it hasnt yet been mapped to refinable string).

image003.png

 

Any advice on why I cant find this site column under "Crawled properties"  yet? Hopefully I have not missed anything? Please help

Hi @vassp1980, I will check it on my environment and let you know soon :)

@vassp1980Ok, I had a similar issue, but after reindexing the library, I managed to get the column in managed properties, which could be used in the PnP Search web part.

 

Reindex library -> advanced options

michalkornet_1-1719215792547.png

 

New managed property

michalkornet_0-1719215769032.png

Selected properties in PnP Search webpart

michalkornet_2-1719215852000.png