How to obtain termvectors api results for a multi-fields text?

I can't figure out the syntax to get the termvectors details for a multi-field text
here is my mapping :

fiche_es": {
  "properties": {
    "es_article": {
      "type": "nested",
        "properties": {
          "ar_titre": {
            "analyzer": "analyse_mots_clefs_combines",
            "type": "string",
            "fields": {
                 "search": {
                      "similarity": "BM25",
                      "analyzer": "analyse_texte_libre",
                      "term_vector": "with_positions_offsets",
                      "type": "string"
                 },
                 "raw": {
                      "similarity": "BM25",
                      "analyzer": "analyse_mots_clefs",
                      "term_vector": "with_positions_offsets",
                      "type": "string"
                 }
             }
       }
...

how can I get the term vector for es_article.ar_titre.search ?
This code

curl -XPOST 'http://host/index/fiche_es/<id>/_termvectors' -d '{
  "fields": [
    "es_article.ar_article.search"
  ]
}'

fails, while this one

curl -XPOST 'http://host/index/fiche_es/<id>/_termvectors' -d '{
  "fields": [
    "es_article.ar_article"
  ]
}'

returns the result for the "root" of the field, which have its own analyzer, and not the multi-fields

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.