Search Organization with wildcard

I would like to search for an organization with Id or field value that is incomplete. I.e. I want to do something like this in SQL “WHERE Id LIKE ‘%12345’”. Is this possible?

It doesn’t seem to work with the OrganizationService, it needs an exact match on Id.
Lucene have no indexes for Organizations.
DataService has “eq” and “neq” as comparisons.
Am I missing something?

Litium version: [7]

For a text field (like LegalRegistrationNumber) there are more comparison options: null, any, contains, eq, neq, not-contains

If it’s the Id, you can use contains there as well:

using (var query = _dataService.CreateQuery<Organization>())
{
	var q = query.Filter(filter => filter
		.Id("contains", "1234"));
	
	// to-do
}

Keep in mind the data service hits the database directly, bypassing the cache.

Great, I will try it out. Are these options documented anywhere, because I couldn’t find more than “eq” and “neq”? I’m fully aware of the performance hit, it takes ~8 sec to get 8k organizations.

There’s a snippet of code on the bottom of this page that you can use to get the available options for a field: https://docs.litium.com/documentation/architecture/data-service#querying

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.