0

I'm working on Sharepoint 2013 and I have a site column named Location tied to a taxonomy, you will have the corresponding managed property to query against: owstaxIdLocation.

I want to create two query using Search functionality:

1) search all data with a certain content type and owstaxIdLocation equal to value1 OR value2;

2) search all data with a certain content type and owstaxIdLocation equal to value1 AND value2 (e.g. value1;value2).

My problem is with multi value managed property owstaxIdLocation. For example:

ContentTypeId:0x0... AND owstaxIdLocation=???

How can I do it?

  • do you want CAML query for custom retrieval or you are using Search functionality ? also please edit your questions with queries you tried and what results you are getting. – Siddharth Vaghasia Nov 14 '16 at 10:05
  • I'm using Search functionality. I edited my answer. – Matteo Bernardon Nov 14 '16 at 10:33
1
ContentTypeId:0x0... AND (owstaxIdLocation:"GP0|#GUID" OR owstaxIdLocation:"GP0|#OtherTermGUID")

Or don't use owstaxIdLocation. Search crawled properties for ows_Location or whatever your column is called and create a managed property for that. Then search for term labels rather than IDs.

See MSDN (Data format for Managed Metadata) for more details about using managed properties.

0

Try with this query for 1.)

{| owstaxIdLocation:{Page.Location} }

This will return each value from owstaxIdLocation on page with that multi value property on it.

(ContentTypeId:0x0...) 
AND
(
( owstaxIdLocation:#GUID1 )
OR 
( owstaxIdLocation:#GUID2 )
) 

for 2.)

(ContentTypeId:0x0...) 
AND
(
( owstaxIdLocation:#GUID1 )
AND
( owstaxIdLocation:#GUID2 )
) 

you can find GUID in Term Store Management for each term

  • You might want to explain what you think the end result will be here? How does Page.Location have any relevance to the owstaxIdLocation managed property? – Bunzab Nov 14 '16 at 14:28
  • I have updated my answer – Marko Tica Nov 14 '16 at 14:48

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.