0

I have attachment plugin for Elasticsearch to index all my file stored in Document. I would like to excludes the file content from being stored in the _source.

My config file look likes:

            document:
                mappings:
                    id: { index: not_analyzed }
                    path: {}
                    name: { boost: 5}
                    file:
                        type: attachment
                        store: "yes"
                        fields:
                            title: { store : "yes" }
                            file : {term_vector: "with_positions_offsets", store: yes}
                        analyzer: standard
                        boost: 2

                persistence:
                    driver: orm
                    model: ACF\CaseBundle\Entity\Document
                    listener:
                    finder:
                    provider:
                        batch_size: 100

                _source:
                    excludes:
                        file: ~

When I run foq:elastica:populate I still see the "file" attribute being stored in _source. I can not figure out what is missing. Please help

channa ly
  • 9,479
  • 14
  • 53
  • 86
  • What's the name of your type? What do you see when you get back the mapping from elasticsearch? The same as you submitted or only a part of it? – javanna Apr 29 '13 at 18:21
  • Thanks you for your response. It is a config for foqelasticabundle in symfony2. the name of type if "document". It is an attachment type. When I did a query to "document", the result in _source still included "file" attribute. – channa ly Apr 30 '13 at 04:50

1 Answers1

0

If anyone else comes across this problem, if you exclude your properties as follows it should just work:

               _source:
                    excludes:
                        [ file ]
frak
  • 858
  • 1
  • 10
  • 30