Fetching the results from two indexes - how to?


(Bijuv V) #1

I have some data indexed in Index 1 - for e.g - I have all of the routes
of a train listed in Index 1.

I can search the train that goes in a particular route by querying the
index 1. This is ok.

I have another index that has has the details of all trains that are under
maintenance.

So from Index 2, I can get all trains that are under maintenance.

Now the question is :

How do I write a query that will list the routes of trains that are under
maintenance and 2) list the routes of the train that are not under
maintenance.

--
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/6e71f8c1-36fe-45fe-85a8-7122e006d53f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Bijuv V) #2

Can you suggest if this is possible or this is not possible using query DSL
? If you think its possible, a pointer would also help.

Op donderdag 19 december 2013 01:35:24 UTC+1 schreef Bijuv V:

I have some data indexed in Index 1 - for e.g - I have all of the routes
of a train listed in Index 1.

I can search the train that goes in a particular route by querying the
index 1. This is ok.

I have another index that has has the details of all trains that are under
maintenance.

So from Index 2, I can get all trains that are under maintenance.

Now the question is :

How do I write a query that will list the routes of trains that are under
maintenance and 2) list the routes of the train that are not under
maintenance.

--
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/334ce1d9-c7bb-43a6-b6c6-ae357ce1b86a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Jun Ohtani) #3

Hi,

Do you want to search across multiple indexes (index1 and index2) ?

If do that, you try following query or comma separate notation.

Does it make sense?

--
Jun Ohtani

2013/12/19 Bijuv V vvbiju2005@gmail.com

Can you suggest if this is possible or this is not possible using query
DSL ? If you think its possible, a pointer would also help.

Op donderdag 19 december 2013 01:35:24 UTC+1 schreef Bijuv V:

I have some data indexed in Index 1 - for e.g - I have all of the routes
of a train listed in Index 1.

I can search the train that goes in a particular route by querying the
index 1. This is ok.

I have another index that has has the details of all trains that are
under maintenance.

So from Index 2, I can get all trains that are under maintenance.

Now the question is :

How do I write a query that will list the routes of trains that are under
maintenance and 2) list the routes of the train that are not under
maintenance.

--
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/334ce1d9-c7bb-43a6-b6c6-ae357ce1b86a%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--

Jun Ohtani
blog : http://blog.johtani.info

--
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/CAPW8A5xFBqkNg6yTzCKtLe0Gcomk45LmcQoFDcLJopHVsMO5OQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Bijuv V) #4

Thanks for pointing to multiple indexes. I went through the documentation
and it doesn't tell as to how to join the data from 2 indices.

It looks like giving the result that matches certain queries from both the
indexes. For e.g. Wow word from different comment sources.

On Thu, Dec 19, 2013 at 11:02 AM, Jun Ohtani johtani@gmail.com wrote:

Hi,

Do you want to search across multiple indexes (index1 and index2) ?

If do that, you try following query or comma separate notation.

  • Indices query

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-indices-query.html

  • Multiple Indices

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/multi-index.html

Does it make sense?

--
Jun Ohtani

2013/12/19 Bijuv V vvbiju2005@gmail.com

Can you suggest if this is possible or this is not possible using query
DSL ? If you think its possible, a pointer would also help.

Op donderdag 19 december 2013 01:35:24 UTC+1 schreef Bijuv V:

I have some data indexed in Index 1 - for e.g - I have all of the
routes of a train listed in Index 1.

I can search the train that goes in a particular route by querying the
index 1. This is ok.

I have another index that has has the details of all trains that are
under maintenance.

So from Index 2, I can get all trains that are under maintenance.

Now the question is :

How do I write a query that will list the routes of trains that are
under maintenance and 2) list the routes of the train that are not under
maintenance.

--
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/334ce1d9-c7bb-43a6-b6c6-ae357ce1b86a%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--

Jun Ohtani
blog : http://blog.johtani.info

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/9HeWGY25HgU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPW8A5xFBqkNg6yTzCKtLe0Gcomk45LmcQoFDcLJopHVsMO5OQ%40mail.gmail.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALU-2jzahWiNxMmFhFzPgW8DCLLDp-VUi1SS6JS_45tOh8obTg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Jun Ohtani) #5

Hi,

Do you want to search parent-child data structure?
Like these?

http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/

2013/12/19 Bijuv V vvbiju2005@gmail.com

Thanks for pointing to multiple indexes. I went through the documentation
and it doesn't tell as to how to join the data from 2 indices.

It looks like giving the result that matches certain queries from both the
indexes. For e.g. Wow word from different comment sources.

On Thu, Dec 19, 2013 at 11:02 AM, Jun Ohtani johtani@gmail.com wrote:

Hi,

Do you want to search across multiple indexes (index1 and index2) ?

If do that, you try following query or comma separate notation.

  • Indices query

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-indices-query.html

  • Multiple Indices

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/multi-index.html

Does it make sense?

--
Jun Ohtani

2013/12/19 Bijuv V vvbiju2005@gmail.com

Can you suggest if this is possible or this is not possible using query
DSL ? If you think its possible, a pointer would also help.

Op donderdag 19 december 2013 01:35:24 UTC+1 schreef Bijuv V:

I have some data indexed in Index 1 - for e.g - I have all of the
routes of a train listed in Index 1.

I can search the train that goes in a particular route by querying the
index 1. This is ok.

I have another index that has has the details of all trains that are
under maintenance.

So from Index 2, I can get all trains that are under maintenance.

Now the question is :

How do I write a query that will list the routes of trains that are
under maintenance and 2) list the routes of the train that are not under
maintenance.

--
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/334ce1d9-c7bb-43a6-b6c6-ae357ce1b86a%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--

Jun Ohtani
blog : http://blog.johtani.info

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/9HeWGY25HgU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPW8A5xFBqkNg6yTzCKtLe0Gcomk45LmcQoFDcLJopHVsMO5OQ%40mail.gmail.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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALU-2jzahWiNxMmFhFzPgW8DCLLDp-VUi1SS6JS_45tOh8obTg%40mail.gmail.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--

Jun Ohtani
blog : http://blog.johtani.info

--
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/CAPW8A5wXnu%2Bwk7MrZh56g-s1J-Kse6d5gBXQzdG42nQ5YEEQYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alexander Reelsen) #6

Hey,

check out this presentation by Martijn about document relations with
elasticearch. It should give you a couple of pointers

Alternatively, watch the video from last years berlin buzzwords:
http://www.elasticsearch.org/videos/bbuzz2013-document-relations-with-elasticsearch/

--Alex

On Thu, Dec 19, 2013 at 11:24 AM, Jun Ohtani johtani@gmail.com wrote:

Hi,

Do you want to search parent-child data structure?
Like these?

http://www.elasticsearch.org/blog/managing-relations-inside-elasticsearch/

http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/

2013/12/19 Bijuv V vvbiju2005@gmail.com

Thanks for pointing to multiple indexes. I went through the documentation
and it doesn't tell as to how to join the data from 2 indices.

It looks like giving the result that matches certain queries from both
the indexes. For e.g. Wow word from different comment sources.

On Thu, Dec 19, 2013 at 11:02 AM, Jun Ohtani johtani@gmail.com wrote:

Hi,

Do you want to search across multiple indexes (index1 and index2) ?

If do that, you try following query or comma separate notation.

  • Indices query

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-indices-query.html

  • Multiple Indices

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/multi-index.html

Does it make sense?

--
Jun Ohtani

2013/12/19 Bijuv V vvbiju2005@gmail.com

Can you suggest if this is possible or this is not possible using query
DSL ? If you think its possible, a pointer would also help.

Op donderdag 19 december 2013 01:35:24 UTC+1 schreef Bijuv V:

I have some data indexed in Index 1 - for e.g - I have all of the
routes of a train listed in Index 1.

I can search the train that goes in a particular route by querying the
index 1. This is ok.

I have another index that has has the details of all trains that are
under maintenance.

So from Index 2, I can get all trains that are under maintenance.

Now the question is :

How do I write a query that will list the routes of trains that are
under maintenance and 2) list the routes of the train that are not under
maintenance.

--
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/334ce1d9-c7bb-43a6-b6c6-ae357ce1b86a%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--

Jun Ohtani
blog : http://blog.johtani.info

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/9HeWGY25HgU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPW8A5xFBqkNg6yTzCKtLe0Gcomk45LmcQoFDcLJopHVsMO5OQ%40mail.gmail.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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALU-2jzahWiNxMmFhFzPgW8DCLLDp-VUi1SS6JS_45tOh8obTg%40mail.gmail.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--

Jun Ohtani
blog : http://blog.johtani.info

--
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/CAPW8A5wXnu%2Bwk7MrZh56g-s1J-Kse6d5gBXQzdG42nQ5YEEQYQ%40mail.gmail.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-B3SZhaxB0E5ALpXTwLkicGA1tFHopozzLNEv7mbgfjA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #7