Can't get rid of _source

Hi!

I am creating an index, creating a mapping and importing documents via pyes
into ElasticSearch version 0.20.6.

Although my mapping should disable the _source field, all result items
still contain that field. Is this a problem with pyes?

This is my code, basically:

es.indices.create_index(new_index)
mapping = {
'_source': {'enabled': False},
'_all': {'enabled': True},
...
}
es.indices.put_mapping("submission", {'properties': mapping}, [new_index])

Even the _mapping output from ES confirms this:

submission:
{
properties:
{
_source:
{
type: "object",
enabled: false},
...

However, all my search output contains the _source field per document.

Marian

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Marian,

I think the problem is that your "_source" ended up under "properties", as
if it would be a field from your document. It should be directly under your
"submissions" mapping type. Like:

'submissions': {
'_source': {
'enabled': False
},
'properties': {
#your document's properties here
}
}

I'm not sure how to fix the issue from pyes, I guess you need to make it
like the above and then send with es.indices.put_mapping("submission",
mapping, [new_index])

Best regards,
Radu

http://sematext.com/ -- Elasticsearch -- Solr -- Lucene

On Mon, Apr 8, 2013 at 9:52 PM, Marian Steinbach <marian.steinbach@gmail.com

wrote:

Hi!

I am creating an index, creating a mapping and importing documents via
pyes into Elasticsearch version 0.20.6.

Although my mapping should disable the _source field, all result items
still contain that field. Is this a problem with pyes?

This is my code, basically:

es.indices.create_index(new_index)
mapping = {
'_source': {'enabled': False},
'_all': {'enabled': True},
...
}
es.indices.put_mapping("submission", {'properties': mapping}, [new_index])

Even the _mapping output from ES confirms this:

submission:
{
properties:
{
_source:
{
type: "object",
enabled: false},
...

However, all my search output contains the _source field per document.

Marian

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Am Dienstag, 9. April 2013 08:32:06 UTC+2 schrieb Radu Gheorghe:

Hi Marian,

I think the problem is that your "_source" ended up under "properties", as
if it would be a field from your document. It should be directly under your
"submissions" mapping type. Like: [..]

That was the reason, exactly. Thank you very much!

Marian

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.