Forum Discussion

DominikA9522's avatar
DominikA9522
Brass Contributor
Dec 13, 2023

Exclude "modified" and "author" from Sharepoint search results

Hi Community, 

 

we're trying to set up an internal phone book on sharepoint base. 

Therefor we're using the PnP Modern Search. 

 

When I create a new entry in the sharepoint list "Production Phone" and search for my persons information I get as result, myself and also the Production phone. 

 

Is it possible to exclude the "modified" and "author" field from the PnP Modern Search Results? 

 

It's not an option to use a "system account" because we have to share this account then with other users which creates ressources in the phone book. 

 

Thank you 

  • DaveMehr365's avatar
    DaveMehr365
    Dec 20, 2023

    Hello DominikA9522 

     

    you can add more conditions with OR in your query. As example:

     

    ((Title:{SearchTerms}) OR (Building:{SearchTerms}))

     

    Best, Dave

  • Hello DominikA9522 

     

    you can try to use it with an exactly matching in title, or another field, with your search term. Here are an example search query template

     

    {SearchBoxQuery} Title:{SearchTerms} 

     

     

    I have more then this two entries created with my David Account.

     

    Best, Dave

    • DominikA9522's avatar
      DominikA9522
      Brass Contributor

      Hi DaveMehr365 

       

      thank you very much for your response. 

       

      As additional information: at the moment our Query Text looks like that: {searchTerms} * ContentType:Phonebook

      We created a new content type with some columns ( like Email, Phone numer, firstname, Building,... ). All of them should be searchable with the search text.

       

      I added your suggestion and it works for the "Title" (Lastname) but how it's possible to search then for all other columns? 

       

      Hope you can point me to that. 

       

      Thank you very much. 

       

      Best regards

       

      Dominik

       

       

      • DaveMehr365's avatar
        DaveMehr365
        MVP

        Hello DominikA9522 

         

        you can add more conditions with OR in your query. As example:

         

        ((Title:{SearchTerms}) OR (Building:{SearchTerms}))

         

        Best, Dave

Resources