Hi everyone!
Sorry if this is a dumb question, but I can't find anything about this at
the documentation or foruns on the web.
In my office we are using ES to index crawled news from the web. We crawl
news in three languages: english, portuguese and spanish. Each news is
indexed in the same index (don't distinguished by language in the indexing
process).
We have a service that queries this index and retrieves some documents to
the client. Here is my problem: I would like to choose which analyser to be
used based on the document language, mainly because of the stopwords
(intrinsic to the idiom).
Here is a simple example. Imagine that my query is "Rio de Janeiro". So I
have 3 tokens ("Rio", "de", "Janeiro"). For english and spanish there
aren't stopwords in this query, but in portuguese the token "de" is a
stopword. So, in the query, while evaluating documents, if the document
language is portuguese, I want that ES considers the token "de" as a
stopword, while if the document language is english or spanish don't.
Doing some research, I figured out that I have 3 choices:
1- Index my documents separately by idiom, specifying for each one of the
index which analyser that must be used. (HARD because the software is
already in production);
2- Build an adapter between my service and the ES API. This adapter will
split the original query in three queries, one for each language. Each one
of these queries will be used to search for documents of it's respective
language using the respective analyser;
3- Find some magic functionality that allows me to choose the correct
analyser that should be used for each document, based on the document
language (I don't think that this option exists).
So, I am looking for guidance to which way I should chose. If anyone have
another option please let me know.
Best regards,
Lucas Saldanha
--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.