Please help with the search for

I have a index with 2 types

  1. The price of the goods
    http://localhost:9200/tovar/prices

  2. Goods
    http://localhost:9200/tovar/product

In tovar/prices there is a field tovar_id which corresponds to the _id type
tovar/product
Task: I need to first search for goods, and in найдных goods to withdraw
their prices
Example:

It is a product that
tovar/product - {
_id: 11
"name" : "Tovar name 1"
}

This is his prices
tovar/prices - {
_id: 1
"tovar_id": 11
}
If I do a search request of the goods: "Tovar name 1" I need to bring 2
entries with tovar/product and tovar/prices

  1. tovar/product - because there is compliance by name ("name" : "Tovar
    name 1")
  2. tovar/prices - there is a correspondence of the tovar_id ("tovar_id":
  3. because the product ("name" : "Tovar name 1") _id=11

Why not indexing product with its price?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 25 janv. 2013 à 07:21, Николай Измайлов nekulin123@gmail.com a écrit :

I have a index with 2 types

  1. The price of the goods
    http://localhost:9200/tovar/prices

  2. Goods
    http://localhost:9200/tovar/product

In tovar/prices there is a field tovar_id which corresponds to the _id type tovar/product
Task: I need to first search for goods, and in найдных goods to withdraw their prices
Example:

It is a product that
tovar/product - {
_id: 11
"name" : "Tovar name 1"
}

This is his prices
tovar/prices - {
_id: 1
"tovar_id": 11
}
If I do a search request of the goods: "Tovar name 1" I need to bring 2 entries with tovar/product and tovar/prices

  1. tovar/product - because there is compliance by name ("name" : "Tovar name 1")
  2. tovar/prices - there is a correspondence of the tovar_id ("tovar_id": 11) because the product ("name" : "Tovar name 1") _id=11

--

Indexing everything in single index is definitely a good
idea. Alternatively, you can index prices as children of products and use
has_parent filter to search for prices given the product name.

On Friday, January 25, 2013 2:08:37 AM UTC-5, David Pilato wrote:

Why not indexing product with its price?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 25 janv. 2013 à 07:21, Николай Измайлов <nekul...@gmail.com<javascript:>>
a écrit :

I have a index with 2 types

  1. The price of the goods
    http://localhost:9200/tovar/prices

  2. Goods
    http://localhost:9200/tovar/product

In tovar/prices there is a field tovar_id which corresponds to the _id
type tovar/product
Task: I need to first search for goods, and in найдных goods to withdraw
their prices
Example:

It is a product that
tovar/product - {
_id: 11
"name" : "Tovar name 1"
}

This is his prices
tovar/prices - {
_id: 1
"tovar_id": 11
}
If I do a search request of the goods: "Tovar name 1" I need to bring 2
entries with tovar/product and tovar/prices

  1. tovar/product - because there is compliance by name ("name" : "Tovar
    name 1")
  2. tovar/prices - there is a correspondence of the tovar_id ("tovar_id":
  3. because the product ("name" : "Tovar name 1") _id=11

--
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.