1

I have a search display template showing some documents based on a content type and one of the fields DocOwner, which is a people field.

Using javascript it is simple enough to get the user's display name from the account id B5241@tenant.sharepoint.com and show that.

However the end users are requesting that they should be able to search for the documents owned by a user using the display name like John Scalzi.

I have not been able to find any mapping of managed properties that enables that, so I wonder if it is posible?

Thanks

  • Can't you create your own managed property for your custom field? Or you can also add filters/refiners to left side of search results page which will help your team to filter the documents based on user names. – Ganesh Sanap Feb 21 at 5:28
  • I have tried mapping both the ows_DocOwner and the ows_q_user_DocOwner to managed properties but both seems to contain the account id , not the display name . I am currently using a custom refiner template that does show the display name via js – Kasper Bo Larsen Feb 21 at 18:53
1

I think it is possible using KQL (Keyword Query Language). For this simple need, it is enough to write the following code in the search box:

author:"John Scalzi"

this return all the document that are creating by John Scalzi. If you need to make it more flexible you can use a content search webpart and pass the {searchquery} to it from search box in this way:

author:{searchquery}

and link the search box to content search web part and then user only need the user name in the search box (Any user name!)

Update:

Yes, It is right but you can make other fields searchable too.

If you have centeral admin access you can do it from there otherwise follow below steps:

  1. Go to site level
  2. Go to search schema
  3. Go to Managed Property.
  4. Search the column you want to search then enable the checkbox related to Searchable and Queryable related to that column.

For example you have a field named DocOwner then you should see a field like DocOwnerOWSUser in Managed Property which is mapped to OWS_User_DocOwner (if it doesnt make the mapping).

You should enable the Queryable and Searchable checkbox for this field. (PS: I am ready for Remote Helping if it is necessary just Email me to abdollahkahne@gmail.com)

  • Unfortunately this only applies for the Author field. In this case the DocOwner field only contains the user account like i:0#.f|membership|b5241j@tenant.com :-( but thanks for the answer anyway – Kasper Bo Larsen Feb 20 at 19:14
0

Please link the RefinableString00:OWS_DocOwnerin the Managed Properties. Then use this query at content search :

RefinableString00:{searchquery}

Add a search webpart and link it to content Query and you should see the following results: enter image description here enter image description here enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.