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
tovar/product - because there is compliance by name ("name" : "Tovar
name 1")
tovar/prices - there is a correspondence of the tovar_id ("tovar_id":
because the product ("name" : "Tovar name 1") _id=11
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
tovar/product - because there is compliance by name ("name" : "Tovar name 1")
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
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 25 janv. 2013 à 07:21, Николай Измайлов <nekul...@gmail.com<javascript:>>
a écrit :
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
tovar/product - because there is compliance by name ("name" : "Tovar
name 1")
tovar/prices - there is a correspondence of the tovar_id ("tovar_id":
because the product ("name" : "Tovar name 1") _id=11
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.