Hi Alex,

If the fields you are searching ("TITLE","SHORTDESC") were indexed using an
analyzer that declares synonyms the "multi_match" query will use it. It
happens because the multi_match query use the analyzer explicit defined in
mapping or the default analyzer.[1]

You can explicit declare the analyzer in the query if you want:

POST test/_search
{
    "query": {
        "multi_match": {
           "query": "test",
           "fields": ["title"],
           "analyzer": "standard"
        }
    }
}

[1]
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#_boolean


On Mon, Apr 7, 2014 at 4:29 AM, Alex K <[email protected]> wrote:

> Hello there,
>
> i have a query, example is this:
> {
>     "query": {
>         "bool": {
>             "should": [
>                 {
>                     "multi_match": {
>                         "query": "foo",
>                         "fields": [
>                             "TITLE",
>                             "SHORTDESC"
>                         ],
>                         "type": "phrase_prefix"
>                     }
>                 },
>                 {
>                     "multi_match": {
>                         "query": "foo",
>                         "cutoff_frequency": null,
>                         "fields": [
>                             "TITLE",
>                             "SHORTDESC"
>                         ]
>                     }
>                 }
>             ]
>         }
>     },
>     "filter": {
>         "term": {
>             "ACTIVE": 1
>         }
>     },
>     "sort": {
>         "TITLE": {
>             "order": "asc"
>         }
>     },
>     "size": 7
> }
>
> Now I have the question if I can use synonyms here?
>
> I already saw that you can use a synonym-token inside an analyzer.
> But I have a query here, not an analyzer.
> Do I have to put an analyzer inside the query?
>
> I don't know much about ES yet, so this may be a total stupid question.
> Thank you in advance :-)
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/5fe2d157-b437-4bd8-8a18-8aa4f41f63fe%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/5fe2d157-b437-4bd8-8a18-8aa4f41f63fe%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Luiz Guilherme P. Santos

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAMdL%3DZHOw14zbQuROWbam7%3Dd%3DYkSH3K5DJHEzsz73kqdJ0nsUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to