How to create indexes and types for this use case and search it?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to create indexes and types for this use case and search it?

burzum

Lets start with the mysql database that we have, we have tables like these:

  •          profiles
  •          companies
  •          reviews

Each of these tables has an i18n table for translations:

  •          profile_i18ns
  •          company_i18ns
  •          review_i18ns

Each of the i18n tables has a sub set of fields of the normal table that need to be translatable. So for profiles the table looks like:

id | profile_id | language_id | field_name | other_field_name | ...

We have different domains where each domain has a primary language plus a set of additional languages it supports. This is relevant for the search queries we need to do now.

So for example if I'm going to search for a French word on a domain that has English as primary language, we want to search by the French word but show results in English. A use case here is that you know only the French name but not the English one. In a relational db I would simply join the other language but I have no idea how to do this the best in elastic search.

One of the problems is now how to build the indexes and types to get this task done.

We also need to be able to search across multiple types of data, like profiles, companies, reviews, jobs and a few more. Most, but not all of them are translatable.

The problems we're facing now as elastic search beginners is how to build the index (or indices) and types the best to be fast but also good to search by the given requirements.

 

 

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: How to create indexes and types for this use case and search it?

ppearcy
Hi,
  The key to modeling data with with elasticsearch is to denormalize and push everything you need into each document. 

Probably the best solution is to push every data point you have for each entity into the document. You should be able to namespace the fields with the language in the submitted JSON and you'd refer to each field as language.fieldname. When you query you can either explicitly specify the fields to span (english.name:query OR  french.name:query) or have an _all field, but mixing languages in that is not ideal.

Profile, company, reviews could all be different indexes or different types. 

After you get things going you should explore the different stemmers for each language to customize things further. 

Best Regards,
Paul


On Wednesday, February 6, 2013 7:10:11 AM UTC-7, burzum wrote:

Lets start with the mysql database that we have, we have tables like these:

  •          profiles
  •          companies
  •          reviews

Each of these tables has an i18n table for translations:

  •          profile_i18ns
  •          company_i18ns
  •          review_i18ns

Each of the i18n tables has a sub set of fields of the normal table that need to be translatable. So for profiles the table looks like:

id | profile_id | language_id | field_name | other_field_name | ...

We have different domains where each domain has a primary language plus a set of additional languages it supports. This is relevant for the search queries we need to do now.

So for example if I'm going to search for a French word on a domain that has English as primary language, we want to search by the French word but show results in English. A use case here is that you know only the French name but not the English one. In a relational db I would simply join the other language but I have no idea how to do this the best in elastic search.

One of the problems is now how to build the indexes and types to get this task done.

We also need to be able to search across multiple types of data, like profiles, companies, reviews, jobs and a few more. Most, but not all of them are translatable.

The problems we're facing now as elastic search beginners is how to build the index (or indices) and types the best to be fast but also good to search by the given requirements.

 

 

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.