Thanks David,
I still have some doubts in teh approach you sent.
I am using Elastic version 1.1.1
- I created a mapping called tests
- Created a mapping
curl -XPUT 'http://localhost:9200/tests/_mapping/test' -d '
{
"test" : {
"properties" : {
* "_source" : {"enabled" : false},*
"message" : {"type" : "string" },
"projectId": {"type": "string" },
"userName": {"type": "string"}
}
}
}
'
- Inserted some values inthe index
Example:
curl -XPUT 'http://localhost:9200/tests/test/1' -d '{
"message" : "Cyril here",
"projectId": "1234",
"userName": "rahul"
}'
curl -XPUT 'http://localhost:9200/tests/test/1' -d '{
"message" : "a message Cyril here",
"projectId": 134,
"userName": "cyril"
}'
- Now when i do a search
like http://localhost:9200/tests/test/_search?q="message"
I get _source (which i am not expecting)...what i want to achieve is that
elastic should just index the data but not store the data.
"hits": [ http://localhost:9200/tests/test/_search?q="message"#
{ <http://localhost:9200/tests/test/_search?q=%22message%22#>
"_index": "tests",
"_type": "test",
"_id": "1",
"_score": 0.11506981,
"_source": { <http://localhost:9200/tests/test/_search?q=%22message%22#>
"message": "a message Cyril here",
"projectId": 134,
"userName": "cyril"
}
}
]
Let me know if I am missing on something.
On Monday, April 6, 2015 at 2:05:15 PM UTC+5:30, Cyril Cherian wrote:
Imagine I have some data stored in mongoDB collection.
Example:
Collection name: Users
record1: {
"first":"Cyril",
"age":33,
"id":1234
}
record2: {
"first":"Jeff",
"age":23,
"id":3423
}
My idea is to index this mongo data in the Elastic.
Such that Elastic only stores the IDs but not the full JSON.
So when I query in Elastic for getting users above the age of 30 I must
get only 1234 and not the full JSON.
I will use this ID to search in mongoDB.
The idea is to store only the index info in Elastic while teh full data
may reside on some other DB.
Is this possible ?
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7648f826-549e-4991-8532-9cd6ceb6148d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.