Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 1 character in body
Source Link
Peter Procházka
  • 9.5k
  • 2
  • 30
  • 71

I'm trying to get a list of items from Sitecore that match a custom tag field. This is from an external application so I need to use one of the APIs to do this.

I've tried using the Sitecore ItemService API like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true

However it's not working as I'd hoped it would.

I also read this SSE post and I don't think all of the content in it is correct:

Use the ItemService to perform a content search - as the list of fields you send in the parameters are not the list of fields to search in but are instead the fields you want to return in the response.

This is documented here by Sitecore:

https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/sitecoreservicesclient/the_restful_api_for_the_itemservice

So my question is how do I get a list of items which match a specific tag?

I've also tried using the Facet Option like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true&facet=Tag|{61F954E0-0B1E-431D-B79F-2EDFF6CAD7B6}

The above doesn't work for me because:

  1. I'm forced to enter a 'Term' as this is mandatory, I don't want this as I just want to get any items matching Tags.
  2. The search does not march partial terms, so isn't very useful even if I could pass a search term
  3. I can't seem to limit the search to just search a single field (Tag)
  4. A further complexity is that their may be more than one tag (Item ID) stored against an item and I suspect that the facet filter will only look for full matches, not partial matches.

I would just use the Solr API to do a search, but I don't think I can as Lucene is being used instead of Solr to my knowledge.

Any thoughts on the above would be very welcome.

Update

UPDATE:

I had some kind assistance from Vlad on slack and it's possible to pass * as a search term like so:

https://mysite.com/sitecore/api/ssc/item/search?term=*&facet=_templatename|Article&fields=ItemName,ItemId,TemplateName&includeStandardTemplateFields=true&database=master

It also looks like there are some inconsistencies in the way the field filter works and the facets. Facets have to be lowercase and also require the '_' prefix for standard fields, where as the &fields= list doesn't. I'm still not able to filter on my custom field though or multiple ids.

I'm trying to get a list of items from Sitecore that match a custom tag field. This is from an external application so I need to use one of the APIs to do this.

I've tried using the Sitecore ItemService API like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true

However it's not working as I'd hoped it would.

I also read this SSE post and I don't think all of the content in it is correct:

Use the ItemService to perform a content search - as the list of fields you send in the parameters are not the list of fields to search in but are instead the fields you want to return in the response.

This is documented here by Sitecore:

https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/sitecoreservicesclient/the_restful_api_for_the_itemservice

So my question is how do I get a list of items which match a specific tag?

I've also tried using the Facet Option like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true&facet=Tag|{61F954E0-0B1E-431D-B79F-2EDFF6CAD7B6}

The above doesn't work for me because:

  1. I'm forced to enter a 'Term' as this is mandatory, I don't want this as I just want to get any items matching Tags.
  2. The search does not march partial terms, so isn't very useful even if I could pass a search term
  3. I can't seem to limit the search to just search a single field (Tag)
  4. A further complexity is that their may be more than one tag (Item ID) stored against an item and I suspect that the facet filter will only look for full matches, not partial matches.

I would just use the Solr API to do a search, but I don't think I can as Lucene is being used instead of Solr to my knowledge.

Any thoughts on the above would be very welcome.

Update

I had some kind assistance from Vlad on slack and it's possible to pass * as a search term like so:

https://mysite.com/sitecore/api/ssc/item/search?term=*&facet=_templatename|Article&fields=ItemName,ItemId,TemplateName&includeStandardTemplateFields=true&database=master

It also looks like there are some inconsistencies in the way the field filter works and the facets. Facets have to be lowercase and also require the '_' prefix for standard fields, where as the &fields= list doesn't. I'm still not able to filter on my custom field though or multiple ids.

I'm trying to get a list of items from Sitecore that match a custom tag field. This is from an external application so I need to use one of the APIs to do this.

I've tried using the Sitecore ItemService API like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true

However it's not working as I'd hoped it would.

I also read this SSE post and I don't think all of the content in it is correct:

Use the ItemService to perform a content search - as the list of fields you send in the parameters are not the list of fields to search in but are instead the fields you want to return in the response.

This is documented here by Sitecore:

https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/sitecoreservicesclient/the_restful_api_for_the_itemservice

So my question is how do I get a list of items which match a specific tag?

I've also tried using the Facet Option like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true&facet=Tag|{61F954E0-0B1E-431D-B79F-2EDFF6CAD7B6}

The above doesn't work for me because:

  1. I'm forced to enter a 'Term' as this is mandatory, I don't want this as I just want to get any items matching Tags.
  2. The search does not march partial terms, so isn't very useful even if I could pass a search term
  3. I can't seem to limit the search to just search a single field (Tag)
  4. A further complexity is that their may be more than one tag (Item ID) stored against an item and I suspect that the facet filter will only look for full matches, not partial matches.

I would just use the Solr API to do a search, but I don't think I can as Lucene is being used instead of Solr to my knowledge.

Any thoughts on the above would be very welcome.

UPDATE:

I had some kind assistance from Vlad on slack and it's possible to pass * as a search term like so:

https://mysite.com/sitecore/api/ssc/item/search?term=*&facet=_templatename|Article&fields=ItemName,ItemId,TemplateName&includeStandardTemplateFields=true&database=master

It also looks like there are some inconsistencies in the way the field filter works and the facets. Facets have to be lowercase and also require the '_' prefix for standard fields, where as the &fields= list doesn't. I'm still not able to filter on my custom field though or multiple ids.

Bumped by Community user
added 560 characters in body
Source Link
Adam Seabridge
  • 9.4k
  • 1
  • 33
  • 73

I'm trying to get a list of items from Sitecore that match a custom tag field. This is from an external application so I need to use one of the APIs to do this.

I've tried using the Sitecore ItemService API like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true

However it's not working as I'd hoped it would.

I also read this SSE post and I don't think all of the content in it is correct:

Use the ItemService to perform a content search - as the list of fields you send in the parameters are not the list of fields to search in but are instead the fields you want to return in the response.

This is documented here by Sitecore:

https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/sitecoreservicesclient/the_restful_api_for_the_itemservice

So my question is how do I get a list of items which match a specific tag?

I've also tried using the Facet Option like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true&facet=Tag|{61F954E0-0B1E-431D-B79F-2EDFF6CAD7B6}

The above doesn't work for me because:

  1. I'm forced to enter a 'Term' as this is mandatory, I don't want this as I just want to get any items matching Tags.
  2. The search does not march partial terms, so isn't very useful even if I could pass a search term
  3. I can't seem to limit the search to just search a single field (Tag)
  4. A further complexity is that their may be more than one tag (Item ID) stored against an item and I suspect that the facet filter will only look for full matches, not partial matches.

I would just use the Solr API to do a search, but I don't think I can as Lucene is being used instead of Solr to my knowledge.

Any thoughts on the above would be very welcome.

Update

I had some kind assistance from Vlad on slack and it's possible to pass * as a search term like so:

https://mysite.com/sitecore/api/ssc/item/search?term=*&facet=_templatename|Article&fields=ItemName,ItemId,TemplateName&includeStandardTemplateFields=true&database=master

It also looks like there are some inconsistencies in the way the field filter works and the facets. Facets have to be lowercase and also require the '_' prefix for standard fields, where as the &fields= list doesn't. I'm still not able to filter on my custom field though or multiple ids.

I'm trying to get a list of items from Sitecore that match a custom tag field. This is from an external application so I need to use one of the APIs to do this.

I've tried using the Sitecore ItemService API like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true

However it's not working as I'd hoped it would.

I also read this SSE post and I don't think all of the content in it is correct:

Use the ItemService to perform a content search - as the list of fields you send in the parameters are not the list of fields to search in but are instead the fields you want to return in the response.

This is documented here by Sitecore:

https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/sitecoreservicesclient/the_restful_api_for_the_itemservice

So my question is how do I get a list of items which match a specific tag?

I've also tried using the Facet Option like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true&facet=Tag|{61F954E0-0B1E-431D-B79F-2EDFF6CAD7B6}

The above doesn't work for me because:

  1. I'm forced to enter a 'Term' as this is mandatory, I don't want this as I just want to get any items matching Tags.
  2. The search does not march partial terms, so isn't very useful even if I could pass a search term
  3. I can't seem to limit the search to just search a single field (Tag)
  4. A further complexity is that their may be more than one tag (Item ID) stored against an item and I suspect that the facet filter will only look for full matches, not partial matches.

I would just use the Solr API to do a search, but I don't think I can as Lucene is being used instead of Solr to my knowledge.

Any thoughts on the above would be very welcome.

I'm trying to get a list of items from Sitecore that match a custom tag field. This is from an external application so I need to use one of the APIs to do this.

I've tried using the Sitecore ItemService API like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true

However it's not working as I'd hoped it would.

I also read this SSE post and I don't think all of the content in it is correct:

Use the ItemService to perform a content search - as the list of fields you send in the parameters are not the list of fields to search in but are instead the fields you want to return in the response.

This is documented here by Sitecore:

https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/sitecoreservicesclient/the_restful_api_for_the_itemservice

So my question is how do I get a list of items which match a specific tag?

I've also tried using the Facet Option like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true&facet=Tag|{61F954E0-0B1E-431D-B79F-2EDFF6CAD7B6}

The above doesn't work for me because:

  1. I'm forced to enter a 'Term' as this is mandatory, I don't want this as I just want to get any items matching Tags.
  2. The search does not march partial terms, so isn't very useful even if I could pass a search term
  3. I can't seem to limit the search to just search a single field (Tag)
  4. A further complexity is that their may be more than one tag (Item ID) stored against an item and I suspect that the facet filter will only look for full matches, not partial matches.

I would just use the Solr API to do a search, but I don't think I can as Lucene is being used instead of Solr to my knowledge.

Any thoughts on the above would be very welcome.

Update

I had some kind assistance from Vlad on slack and it's possible to pass * as a search term like so:

https://mysite.com/sitecore/api/ssc/item/search?term=*&facet=_templatename|Article&fields=ItemName,ItemId,TemplateName&includeStandardTemplateFields=true&database=master

It also looks like there are some inconsistencies in the way the field filter works and the facets. Facets have to be lowercase and also require the '_' prefix for standard fields, where as the &fields= list doesn't. I'm still not able to filter on my custom field though or multiple ids.

Source Link
Adam Seabridge
  • 9.4k
  • 1
  • 33
  • 73

Getting a list of items from the ItemService API matching a specific field value

I'm trying to get a list of items from Sitecore that match a custom tag field. This is from an external application so I need to use one of the APIs to do this.

I've tried using the Sitecore ItemService API like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true

However it's not working as I'd hoped it would.

I also read this SSE post and I don't think all of the content in it is correct:

Use the ItemService to perform a content search - as the list of fields you send in the parameters are not the list of fields to search in but are instead the fields you want to return in the response.

This is documented here by Sitecore:

https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/sitecoreservicesclient/the_restful_api_for_the_itemservice

So my question is how do I get a list of items which match a specific tag?

I've also tried using the Facet Option like so:

https://{baseurl}/sitecore/api/ssc/item/search?Term=technology&fields=ItemName,ItemId,Tag&includeStandardTemplateFields=true&facet=Tag|{61F954E0-0B1E-431D-B79F-2EDFF6CAD7B6}

The above doesn't work for me because:

  1. I'm forced to enter a 'Term' as this is mandatory, I don't want this as I just want to get any items matching Tags.
  2. The search does not march partial terms, so isn't very useful even if I could pass a search term
  3. I can't seem to limit the search to just search a single field (Tag)
  4. A further complexity is that their may be more than one tag (Item ID) stored against an item and I suspect that the facet filter will only look for full matches, not partial matches.

I would just use the Solr API to do a search, but I don't think I can as Lucene is being used instead of Solr to my knowledge.

Any thoughts on the above would be very welcome.