Search for organizations using SearchService


Is it possible to search for organizations with a specific field value using the SearchService?

I use this to search for products:

var request = new QueryRequest(language.SystemId, ProductCatalogSearchDomains.Products, _securityToken);
request.QueryTags.Add(new Tag(TagNames.BaseProductId, item.Kod + "*"));

var hits = Solution.Instance.SearchService.Search(request)?.Hits;
IEnumerable<Guid> variantSystemIds = null;

if (hits != null)
    variantSystemIds = hits.Select(x => new Guid(x.Id));

Litium version: 7.1

I saw this right now:

So the recommeded way here is to use the DataService, correct?

Yes, Lucene is available for Website, Sales and Products. For anything else you should use the Data Service.

When using the data service, keep this in mind:

Query information with data service is bypassing the caches. You should not use it without a cache if the result is to be used on public pages for visitors.

Thank you Nils!

This is only for integration purpose in nightly scheduled task.

1 Like