# Search Organization with wildcard

**URL:** <https://forum.litium.com/t/search-organization-with-wildcard/972>\
**Category:** Questions\
**Tags:** litium-7\
**Created:** [July 8, 2019, 2:29pm UTC](https://forum.litium.com/t/search-organization-with-wildcard/972 "2019-07-08T14:29:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlbinB](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@AlbinB](https://forum.litium.com/u/AlbinB)\
**Post date:** [July 8, 2019, 2:29pm UTC](https://forum.litium.com/t/search-organization-with-wildcard/972/1 "2019-07-08T14:29:20Z")

</div>

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]_

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [July 9, 2019, 6:48am UTC](https://forum.litium.com/t/search-organization-with-wildcard/972/2 "2019-07-09T06:48:35Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![AlbinB](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@AlbinB](https://forum.litium.com/u/AlbinB)\
**Post date:** [July 9, 2019, 6:58am UTC](https://forum.litium.com/t/search-organization-with-wildcard/972/3 "2019-07-09T06:58:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [July 9, 2019, 7:02am UTC](https://forum.litium.com/t/search-organization-with-wildcard/972/4 "2019-07-09T07:02:38Z")

</div>

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](https://docs.litium.com/documentation/architecture/data-service#querying)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [August 6, 2019, 7:02am UTC](https://forum.litium.com/t/search-organization-with-wildcard/972/5 "2019-08-06T07:02:43Z")

</div>

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