Return just the Json document id

We are planning to index Json document that could be as big as 200K. When
user executes search we just want the matching doc id instead of the entire
documents. How can I just get the id of the Json document?

Don't store source.

Le 30 mai 2012 à 21:12, Mohit Anchlia mohitanchlia@gmail.com a écrit :

We are planning to index Json document that could be as big as 200K. When user executes search we just want the matching doc id instead of the entire documents. How can I just get the id of the Json document?

On Wed, May 30, 2012 at 12:23 PM, David Pilato david@pilato.fr wrote:

Don't store source.
Elasticsearch Platform — Find real-time answers at scale | Elastic

If I do store some portions of _source is it possible to fetch only few
fields instead of fetching all of them which seems to be the default?

Le 30 mai 2012 à 21:12, Mohit Anchlia mohitanchlia@gmail.com a écrit :

We are planning to index Json document that could be as big as 200K.
When user executes search we just want the matching doc id instead of the
entire documents. How can I just get the id of the Json document?

Yes. For each field you can set store to yes : Elasticsearch Platform — Find real-time answers at scale | Elastic

Then, you will be able to get it back (but not as a partial document).

HTH
David

Le 30 mai 2012 à 21:38, Mohit Anchlia mohitanchlia@gmail.com a écrit :

On Wed, May 30, 2012 at 12:23 PM, David Pilato david@pilato.fr wrote:
Don't store source.
Elasticsearch Platform — Find real-time answers at scale | Elastic

If I do store some portions of _source is it possible to fetch only few fields instead of fetching all of them which seems to be the default?

Le 30 mai 2012 à 21:12, Mohit Anchlia mohitanchlia@gmail.com a écrit :

We are planning to index Json document that could be as big as 200K. When user executes search we just want the matching doc id instead of the entire documents. How can I just get the id of the Json document?

On Wed, May 30, 2012 at 12:45 PM, David Pilato david@pilato.fr wrote:

Yes. For each field you can set store to yes :
Elasticsearch Platform — Find real-time answers at scale | Elastic

Then, you will be able to get it back (but not as a partial document).

Thanks! How does it work for nested document. If I specify it on the parent
does it store all the child elements too?

HTH
David

Le 30 mai 2012 à 21:38, Mohit Anchlia mohitanchlia@gmail.com a écrit :

On Wed, May 30, 2012 at 12:23 PM, David Pilato david@pilato.fr wrote:

Don't store source.
Elasticsearch Platform — Find real-time answers at scale | Elastic

If I do store some portions of _source is it possible to fetch only few
fields instead of fetching all of them which seems to be the default?

Le 30 mai 2012 à 21:12, Mohit Anchlia mohitanchlia@gmail.com a écrit :

We are planning to index Json document that could be as big as 200K.
When user executes search we just want the matching doc id instead of the
entire documents. How can I just get the id of the Json document?

I don't know. I never used nested.

Sorry :wink:

Le 30 mai 2012 à 21:54, Mohit Anchlia mohitanchlia@gmail.com a écrit :

On Wed, May 30, 2012 at 12:45 PM, David Pilato david@pilato.fr wrote:
Yes. For each field you can set store to yes : Elasticsearch Platform — Find real-time answers at scale | Elastic

Then, you will be able to get it back (but not as a partial document).

Thanks! How does it work for nested document. If I specify it on the parent does it store all the child elements too?

HTH
David

Le 30 mai 2012 à 21:38, Mohit Anchlia mohitanchlia@gmail.com a écrit :

On Wed, May 30, 2012 at 12:23 PM, David Pilato david@pilato.fr wrote:
Don't store source.
Elasticsearch Platform — Find real-time answers at scale | Elastic

If I do store some portions of _source is it possible to fetch only few fields instead of fetching all of them which seems to be the default?

Le 30 mai 2012 à 21:12, Mohit Anchlia mohitanchlia@gmail.com a écrit :

We are planning to index Json document that could be as big as 200K. When user executes search we just want the matching doc id instead of the entire documents. How can I just get the id of the Json document?

Thanks! I'll try it out and see how it goes

On Wed, May 30, 2012 at 1:12 PM, David Pilato david@pilato.fr wrote:

I don't know. I never used nested.

Sorry :wink:

Le 30 mai 2012 à 21:54, Mohit Anchlia mohitanchlia@gmail.com a écrit :

On Wed, May 30, 2012 at 12:45 PM, David Pilato david@pilato.fr wrote:

Yes. For each field you can set store to yes :
Elasticsearch Platform — Find real-time answers at scale | Elastic

Then, you will be able to get it back (but not as a partial document).

Thanks! How does it work for nested document. If I specify it on the
parent does it store all the child elements too?

HTH
David

Le 30 mai 2012 à 21:38, Mohit Anchlia mohitanchlia@gmail.com a écrit :

On Wed, May 30, 2012 at 12:23 PM, David Pilato david@pilato.fr wrote:

Don't store source.
Elasticsearch Platform — Find real-time answers at scale | Elastic

If I do store some portions of _source is it possible to fetch only few
fields instead of fetching all of them which seems to be the default?

Le 30 mai 2012 à 21:12, Mohit Anchlia mohitanchlia@gmail.com a écrit :

We are planning to index Json document that could be as big as 200K.
When user executes search we just want the matching doc id instead of the
entire documents. How can I just get the id of the Json document?

You also use partial fields to tell it what to return. Passing an empty {} list will give you just the _id and _type fields.

http://www.elasticsearch.org/guide/reference/api/search/fields.html