Filter query in Squidex UI and in code for multilingual site


#1

Hello Sebastian.

I have an example app with two languages configured.

en-US and sv-SE.

I have a schema with a field slug.

Now when I try to query / filter by slug in the Squidex UI / C# code I get:

$filter=data/slug/en_us eq 'some-slug'

Query $filter clause not valid: Could not find a property named 'en_us' on type 'Db.MyEntity.Data.Slug'.

I’m following the recommendations here (which is the latest thread that I could find) but I can’t get it to work.

https://support.squidex.io/t/solved-localization-with-a-hyphen-cant-be-filtered-on/262/7

Any ideas?

Here’s how the JSON looks like:

{
    "total": 1,
    "items": [
        {
            "id": "b0963131-8b41-418e-a742-e473ac76c344",
            "createdBy": "subject:5ccdd5287a862e0001baaea0",
            "lastModifiedBy": "subject:5ccdd5287a862e0001baaea0",
            "data": {        
                "slug": {
                    "en-US": "some-slug"
                }
            },
            "isPending": false,
            "created": "2019-06-12T16:59:18Z",
            "lastModified": "2019-06-14T19:45:05Z",
            "status": "Published",
            "version": 5
        }
}

#2

Have you checked the casing?


#3

yes, it’s all lowercase, field names, slug value.


#4

I’m an idiot. I put en_us instead of en_US in the query. Thanks!


#5

Yes, this is what I meant :smiley: