News web part filtering

%3CLINGO-SUB%20id%3D%22lingo-sub-2234019%22%20slang%3D%22en-US%22%3ENews%20web%20part%20filtering%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2234019%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHi%20All%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20have%20a%20news%20web%20part%20on%20a%20hub%20site%20that%20gets%20news%20from%20all%20associated%20sites.%20I%20want%20to%20show%20news%20only%20when%20the%20news%20type%20%3D%20Main%20News%20%3CSTRONG%3EAND%3C%2FSTRONG%3E%20IsActive%20%3D%20Yes.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWhen%20I%20add%20Two%20filters%20under%20the%20Managed%20Property%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E1st%20filter%20-%20News%20type%20%3D%20Main%20News%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E2nd%20filter%20-%20IsActive%20%3D%20Yes%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EIt%20filters%20with%20OR%20not%20AND.%20How%20can%20I%20get%20AND%20condition%3F%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EThanks.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2234019%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2234223%22%20slang%3D%22en-US%22%3ERe%3A%20News%20web%20part%20filtering%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2234223%22%20slang%3D%22en-US%22%3ECurrently%2C%20only%20OR%20is%20supported%20on%20the%20News%20Web%20Part.%3C%2FLINGO-BODY%3E
Contributor

Hi All,

I have a news web part on a hub site that gets news from all associated sites. I want to show news only when the news type = Main News AND IsActive = Yes.

 

When I add Two filters under the Managed Property
1st filter - News type = Main News
2nd filter - IsActive = Yes
It filters with OR not AND. How can I get AND condition?
Thanks.

4 Replies
Currently, only OR is supported on the News Web Part.
So that means there is no way I can achieve this? Any idea pl.
Thanks.
No. At least at the current version, it's not possible to modify the actual query.

One out-of-the-box alternative is to use Highlighted Content Web Part, where you can define the exact search query. Of course, layout options are different.

If you want to fully customize the search query and the result layout, the PnP Search result web part is the way to go. https://microsoft-search.github.io/pnp-modern-search/
Found that if you use same filter type it will take OR but if you use different type filters it will take AND. E.g managed property AND Title contains/Created by etc.