ElasticSearch: Design schema for hieararchy level data? -


for object have data in format

title, description, tag

e.g here mobile, tablet, real estate have tag heirachy this

electronics - > mobile -> samsung electronics - > mobile -> nokia electronics - > tablet -> samsung realestate - > rent -> villa 

now want query like

1. find "mobile" of brand "samsung" exist in "electronics" category 2. find "tablet" of brand "samsung" exist in "electronics" category 3. find "tablet" of brand "samsung" exist in "electronics" category 3. find "villa" "rent" exist in "realestate" category 

how can design es schema kind of hearahi level data?

this feels best case flat structure number of properties can query for.

{   "product": "mobile",   "brand": "samsung",   "category": "electronics",   "anotherproperty": "and on" } 

this basic approach let's queries need.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -