Can the ES do so

Hello. I am new at ES and would like to ask for help with some issues.

As I understood, there is only one kind of synonyms in the ES: words are
simply replaced by a synonym.

Is that possible to add synonym to word instead of replacing?

For example:

“some help & hhhhhhhhh”

“some support & hhhhhhhhh”

As a result, I want analyzer to make three tokens from the text «some
help»:

[{"token":"some","type":"ALPHANYM"…},{"token":"help","type":"ALPHANYM"…},{"token":"hhhhhhhhh","type":"SYNONYM2"…}]

Next, if you search for the phrase «some help» – it would search by the
following logic: «(some AND help) OR hhhhhhhhh». As a result, records «some
support» also will be in search output. Finally, the score of records «some
help» for that request must be bigger than the score of records «some
support».

How can I implement this in ES?

P.S.: the fact is that I already have an active project and I would like to
migrate it to ES.

--

Welcome!

I think you can do it using different analyzers for the same field. One won't
touch the field, the other one will index the synonym.
Have a look at the multifield feature:
http://www.elasticsearch.org/guide/reference/mapping/multi-field-type.html

HTH
David.

Le 13 décembre 2012 à 14:34, Alexander Kaskevich alexander.kaskevich@gmail.com
a écrit :

Hello. I am new at ES and would like to ask for help with some issues.

As I understood, there is only one kind of synonyms in the ES: words are
simply replaced by a synonym.

Is that possible to add synonym to word instead of replacing?

For example:

“some help & hhhhhhhhh”

“some support & hhhhhhhhh”

As a result, I want analyzer to make three tokens from the text «some help»:

[{"token":"some","type":"ALPHANYM"…},{"token":"help","type":"ALPHANYM"…},{"token":"hhhhhhhhh","type":"SYNONYM2"…}]

Next, if you search for the phrase «some help» – it would search by the
following logic: «(some AND help) OR hhhhhhhhh». As a result, records «some
support» also will be in search output. Finally, the score of records «some
help» for that request must be bigger than the score of records «some
support».

How can I implement this in ES?

P.S.: the fact is that I already have an active project and I would like to
migrate it to ES.

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

Multifield is a great idea. It helped me. Thank you.
Now I’m trying to adept it for other use (search feature) but I don’t
understand how to do that.
I call it "minus words".
Example: I have dictionary, like "some help=>small". And have 3 documents:
"some help", "small some help", "big some help".
And when I search "some help" I should find "some help" and "big some help"
but not "small some help" (or "some help small", or "some help very
small"). This result is equal query "NOT small AND some AND help".
But if I search "small some help" this doc should be found.
First of all, I made synonym filter: "some help=>small". Then I made
multifield with this filter.
I tryed to use various ways but still can’t find right one.
Big problem is that if you have phrase that is not from dictionary – it
stay as is.
Have I possibility to remove "ALPHANUM" tokens? Or may be I can filter by
token type? Or may be you have some other ideas?

четверг, 13 декабря 2012 г., 16:44:36 UTC+3 пользователь David Pilato
написал:

Welcome!

I think you can do it using different analyzers for the same field. One
won't touch the field, the other one will index the synonym.
Have a look at the multifield feature:
http://www.elasticsearch.org/guide/reference/mapping/multi-field-type.html

HTH
David.

Le 13 décembre 2012 à 14:34, Alexander Kaskevich <alexander...@gmail.com<javascript:>>
a écrit :

Hello. I am new at ES and would like to ask for help with some issues.

As I understood, there is only one kind of synonyms in the ES: words are
simply replaced by a synonym.

Is that possible to add synonym to word instead of replacing?

For example:

“some help & hhhhhhhhh”

“some support & hhhhhhhhh”

As a result, I want analyzer to make three tokens from the text «some
help»:

[{"token":"some","type":"ALPHANYM"…},{"token":"help","type":"ALPHANYM"…},{"token":"hhhhhhhhh","type":"SYNONYM2"…}]

Next, if you search for the phrase «some help» – it would search by the
following logic: «(some AND help) OR hhhhhhhhh». As a result, records «some
support» also will be in search output. Finally, the score of records «some
help» for that request must be bigger than the score of records «some
support».

How can I implement this in ES?

P.S.: the fact is that I already have an active project and I would like
to migrate it to ES.

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--