Attachment field analyzed and not_analyzed


(valerio) #1

Hi There, i need to use attachment field as both analyzed and not_analyzed fields.

I've tried the following configuration but it doesn't work.

                 "claims_IT": {
                    "type": "attachment",
                        "fields": {
                            "content": {
                                "type": "string",
                                "term_vector":"with_positions_offsets",
                                "analyzer": "italian"
                                },
                            "raw": {
                                "type": "string",
                                "term_vector":"with_positions_offsets",
                                "index": "not_analyzed"
                                }
                            }
                 }

But i get an error raw:string is not allowed!

Then i thought this as possible solution. Is that fine?

                 "claims_IT": {
                    "type": "attachment",
                        "fields": {
                            "content": {
                                "type": "string",
                                "term_vector":"with_positions_offsets",
                                "analyzer": "italian"
                                }
                            }
                 },
                "claims_IT_raw": {
                    "type": "attachment",
                        "fields": {
                            "content": {
                                "type": "string",
                                "term_vector":"with_positions_offsets",
                                "index": "not_analyzed"
                                }
                            }
                 },

Thanx valerio


(system) #2