How to build Query using Content Search Web part (CSWP) combining two sub-sites list items




How to build Query using Content Search Web part combining two sub-sites list items


Suppose we have two sub-sites here. One is called Corporate another is Community.



List id for corporate post: {AD553036-09E6-4647-A08F-1256A89F047A}
%7BAD553036%2D09E6%2D4647%2DA08F%2D1256A89F047A%7D
Here:
%7B = {
%2D = -
%7D = }
{D095E84A-1715-448D-8117-423F7DDA1490}
{F3A4C0D8-2042-40E9-8CB0-0A071978DAE6}

As for two list IDs We can create condition like:

((ListID:D095E84A-1715-448D-8117-423F7DDA1490) OR (ListID:F3A4C0D8-2042-40E9-8CB0-0A071978DAE6))

%7B7CAEA679%2D782C%2D4B6E%2DA83B%2DD963CAB158B4%7D
list id for community post: {7CAEA679-782C-4B6E-A83B-D963CAB158B4}

Column name: Publish Status

owstaxIdPublish_x0020_Status:
owstaxIdPublish%5Fx0020%5FStatus:  here %5F means "_" underscore

Final Query:
owstaxIdStatus:#bda2992f-be00-4fa0-8d0e-41c3a680eb3a ((ListID:7CAEA679-782C-4B6E-A83B-D963CAB158B4) OR (ListID:AD553036-09E6-4647-A08F-1256A89F047A))






owstaxIdStatus , here “owstaxId” is system specific and “Status” is the column/field created on the library as Managed Metadata
ID “#bda2992f-be00-4fa0-8d0e-41c3a680eb3a” for Managed Metadata value “Published” for Status column.


owstaxIdStatus:#bda2992f-be00-4fa0-8d0e-41c3a680eb3a         (Managed Metadata column is: Status and id from Term store management)


ListID:AD553036-09E6-4647-A08F-1256A89F047A
path:http://sharepoint/sites/intranet/corporate/ OR path:http://sharepoint/sites/intranet/community/  ContentTypeId:0x0110*



Comments

Popular posts from this blog

Document library or list when add and delete multiple times in a page as webpart, it is adding version number or the number of times added to that page. How to remove this?

List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user.