Multi language sync and search

I am working with multiple language at my asp.net platform.
I have two languages : English and Hindi

Now I am using for list of string for Name
Example,

var name = new List<string> 
{ 
en-US: "Lenovo Thinkpad X1 Carbon Laptop English"
hi-IN: "Lenovo Thinkpad X1 Carbon Laptop Hindi"
}

So How to sync this and which data type will use for this ?
And how to search by each language ?

Give me example for this,
Thanks

It’s up to you. Manticore supports multiple morphologies. English and Hindi are too different, so I wouldn’t expect morphology conflicts.

Suggest me possible way with example

I suggest you play with Manticore via mysql client like below. I think it will help you do experiments faster and reach your goal sooner:

mysql> drop table if exists t; create table t(eng text, hin text) morphology='lemmatize_en, libstemmer_hi'; insert into t values(0, 'ran', 'दौड़ा'); select * from t where match('दौड़ना'); select * from t where match('run');
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.03 sec)

--------------
create table t(eng text, hin text) morphology='lemmatize_en, libstemmer_hi'
--------------

Query OK, 0 rows affected (0.04 sec)

--------------
insert into t values(0, 'ran', 'दौड़ा')
--------------

Query OK, 1 row affected (0.00 sec)

--------------
select * from t where match('दौड़ना')
--------------

Empty set (0.00 sec)

--------------
select * from t where match('run')
--------------

+---------------------+------+-----------------+
| id                  | eng  | hin             |
+---------------------+------+-----------------+
| 1515343812221005546 | ran  | दौड़ा           |
+---------------------+------+-----------------+
1 row in set (0.00 sec)

After that you can adapt it to the C# client.

I Have too many fields in table/index, and I want to name in mutli language,
So what I have to do ?
Here in your example there is a table any only filed “name” in table

Here is my table

string tableBody = "create table if not exists products (ProductId text,Name string indexed 
attribute,Title string,Sku text,ShortDescription text," +
"FullDescription text,Price float,Published bool,ManufacturerPartNumber text,VendorId integer,Vendor text,CreatedOnUtc bigint,CategoryIds multi," +
"ManufacturerIds multi,ProductTagIds multi,SpecificationOptionIds multi,Categories text,Manufacturers text,ProductAttribute text)";

If I Created two indexes and want to update single object/record,

If I updated single object at English index then it will auto update at Hindi index ?
I mean it will work as replica and forward changes at both indexes ?

Or we have to update same object at both indexes ?

If you have two tables with different settings and different documents, you have to update them separately. If you have two tables in a replication cluster an update will be propagated to other nodes of the cluster automatically. But in this case you can’t have settings/documents in English in one table and in Hindi in another.

This means we have two column in table “eng” and “hin” ? Or a single column ?
Example, I want to save “name” in both language then I have to declare two column or single column ?
If two column then it should be below or different ? If different then suggest

create table t(name_eng text, name_hin text) morphology=‘lemmatize_en, libstemmer_hi’

Morphology is tricky ? I tried to understand how to declare but not getting.
How to insert data in morphology table using asp.net client ?
And how to search from morphology table using asp.net client ?

Hello team manticore,
Anyone are there ? Please help me for this…

Yes, eng text, hin text in create table means you’ll have 2 columns, not one.

How to insert data in morphology table using asp.net client ?

Just insert. Once you declare morphology in CREATE TABLE or in the config you don’t have to do anything else when you insert a document(s).

And how to search from morphology table using asp.net client ?

Again, nothing special, just search.

Anyone are there ? Please help me for this…

If you want to progress faster with Manticore without the need to wait for us to answer your questions, please consider:

Especially when it’s not related with C# like how many columns you’ll get if you define two columns in CREATE TABLE or how declaring a morphology affects your INSERT/SELECT queries, you can find it all there.

Hello sergey,
Now I have one more language Bengali, so total three languages : English, Hindi and Bengali
then how to declare morphology ?

Hello

Like this:

morphology = smth, smth_else, smth_else

I’m not sure about the order in your case. Experiment with it.

I am using multiiple language

here is my table
CREATE TABLE myproducts(name json)

insert into myproducts(name) values(‘{“standard”: “Apple iphone 14 pro”, “en”: “”, “hi”: “”}’)
insert into myproducts(name) values(‘{“standard”: “Apple iphone 14 plus”, “en”: “”, “hi”: “”}’)

Now I want to search from name.en with “apple” keyword
If there is no value or null value for name.en then I want to search from name.standard

What should be SQL query for this ? Please help me.

It is done. Thank you team manticore.