Closed emaudoux closed 8 years ago
@emaudoux please upload a complete recreation in curl syntax. You haven't given us the index settings, the mappings, or the document. Btw, with the Perl client just do:
$e = Search::Elasticsearch->new(trace_to => 'Stdout')
and it will dump all your requests in curl syntax
Also, please make the recreation as small as possible - I don't want to have to wade through lots of fields etc that don't form a part of the problem
I'm not sure I understand everything you said above but still , here is my request :
"size" : 10,
"from" : 0,
"body" : {
"query" :{
"bool" : {
"must" : {
"multi_match" : { "query" : $full_recherche{general},
"operator" : "and",
"fields" : [ qw/title recipe ingredients/ ],
}
},
"filter" : [ ... ],
"must_not" : $must_not,
}
},
"highlight" : {
"fields" : {
"recipe" : {}
}
}
}
}
);`
Here is the mapping :
{
"mappings": {
"docs": {
"properties": {
...
"recipe": { "type": "string", "index": "analyzed", "analyzer": "french" },
...
}
}
}
}
@emaudoux Unless you provide a full recreation that we can copy and paste which demonstrates the issue (without having to guess about what values you're passing in), nobody is likely to look at this.
here's an example of what a full recreation looks like: https://github.com/elastic/elasticsearch/issues/11277#issuecomment-105249937
I finally found the problem, it was a silly mistake, thank you for the time you spent on this. And sorry for the disturbance.
Elasticsearch version: 2.3.2 JVM version: 1.8.0_91 OS version: ubuntu 16.04 LTS
I want ES to return 150 characters of the highlighted parts of the field "recipe". Now there are no change (I think) between when I wrote the "highlight" lines and before:
(nb it is a Perl code but just replace the => by : and you have a typical ES request)
Thank you very much !