Use a different culture for Composition API search

Hello,

in our company we use Person.UID_DialogCulture as the primary display language in both our Angular web application and the old Webportal (since the Webportal overwrites the browser culture if person culture is set).

We have many API endpoints in the Composition API created with the `FromTable()` method especially in order to enable the lucene index search on translated columns. Unfortunately, the search that is invoked by the Composition API automatically uses the Browser Culture for the lucene search query. Hence a Person which for example has EN as his primary browser culture but Person.UID_DialogCulture = QBM-CULT-de-DE is not able to get a proper result as the user expects to search for a german term but the lucene search query searches in the english dictionary behind the scenes.

Is there any way to work around this behavior?

Parents Reply Children
  • thank you for the hint, its going into the right direction. We are using a custom API project. This custom project seems not to return a Culture property. When performing a login against the "portal" API project, the culture is returned.

    Custom API project login response:

    {
        "Status": {
            "PrimaryAuth": {
                "Display": "DGZ012",
                "Uid": "33b79ac2-71d5-4353-87cc-76d36d55d4ae",
                "IsAuthenticated": true,
                "AuthTime": "2022-08-17T05:42:32.4226469Z"
            },
            "SecondaryAuth": {
                "IsAuthenticated": false,
                "IsEnabled": false,
                "Name": "NotRequired"
            }
        },
        "Config": [

    "portal" login response:

    {
        "Status": {
            "PrimaryAuth": {
                "Display": "DGZ012",
                "Uid": "33b79ac2-71d5-4353-87cc-76d36d55d4ae",
                "IsAuthenticated": true,
                "AuthTime": "2022-08-17T05:42:57.6115941Z"
            },
            "SecondaryAuth": {
                "IsAuthenticated": false,
                "IsEnabled": false,
                "Name": "NotRequired"
            },
            "Culture": "de-DE"
        },
        "Config": [

  • Hi Daniel,

    This explains the behavior.

    To use the person's culture for the session, add the SetSessionCulture plugin when building the API. Just add this code to your API initialization:

            public void Build(IApiBuilder builder)
            {
                builder.AddPlugin(new QER.CompositionApi.Person.SetSessionCulture());
            }