A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Index custom type with different languages

Vote:
 

Hi,

We have external data which we need to store in the index and use it in the search.

We are indexing data the following way:

                SearchClient.Instance.Index(new TestItem
                {
                    Id = 1,
                    Heading = "Header 1",
                });

It would be grate to use something like this in the result:

            var result = SearchClient.Instance.Search(Language.Swedish)
                .For(request.Query)
                .GetResult();

What is correct way to index data with several languages?

Best regards,

Pavel

#141754
Nov 19, 2015 15:15
Vote:
 

The Language input is only used for stemming and analyzers.

You should add a language property on your type and use .Filter(...). This is how it works on standard episerver content.

#141757
Nov 19, 2015 15:31
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.