Sharepoint:具有和条件的多个细化过滤器(使用适用于Angular4的rest API)(Sharepoint: Multiple refinement filters with and condition (Using rest API for Angular4))

我使用SharePoint休息API来检索数据:

myURL/_api/search/query?rowlimit=500&trimduplicates=false+ .... + refinementfilters=%27CountryCDH:("USA")%27,%27(ColorChoiceCDH:("Red"),ColorChoiceCDH:("Blue"))%27

这是我的要求:我有三列可以混合搜索数据。

国家(可以是美国,英国,..)

颜色(可以是红色/蓝色/绿色)

类型(S,M,L,XL)

我如何创建精化过滤器查询?

目前正在建立查询的问题。

-1, Microsoft.SharePoint.Client.InvalidClientQueryException The expression "'CountryCDH:("USA")','(ColorChoiceCDH:("Red"),ColorChoiceCDH:("Blue"))'" is not valid.

提前致谢。 帮助我构建查询

I m using SharePoint rest api to retrieve data:

myURL/_api/search/query?rowlimit=500&trimduplicates=false+ .... + refinementfilters=%27CountryCDH:("USA")%27,%27(ColorChoiceCDH:("Red"),ColorChoiceCDH:("Blue"))%27

Here is my requirement: I do have three column which can have mixed search on data.

Country ( It can be USA, UK, ..)

Color ( it can be red/blue/green)

Type ( S, M, L, XL)

How do I create refinement filter query out of it?

Currently getting the issue for building a query.

-1, Microsoft.SharePoint.Client.InvalidClientQueryException The expression "'CountryCDH:("USA")','(ColorChoiceCDH:("Red"),ColorChoiceCDH:("Blue"))'" is not valid.

Thanks in advance. Help me to build query

最满意答案

作为AND和OR的一般模式:

&refinementfilters='or(fileExtension:equals("docx"),fileExtension:equals("pptx"))'

假设你正在使用可精炼的属性,它们可能类似于:

&refinementfilters='and(CountryCDH:equals("USA"),ColorChoiceCDH:equals("Red"),ColorChoiceCDH:equals("Blue"))'

As a general pattern for ANDs and ORs:

&refinementfilters='or(fileExtension:equals("docx"),fileExtension:equals("pptx"))'

Assuming you are using refinable properties, them maybe something like:

&refinementfilters='and(CountryCDH:equals("USA"),ColorChoiceCDH:equals("Red"),ColorChoiceCDH:equals("Blue"))'

更多推荐