Skip to content

Instantly share code, notes, and snippets.

@ToulBoy
ToulBoy / "parent child" data
Created February 29, 2012 15:12
Elasticsearch 0.18.6 : My example of "parent child"
curl -s -XPOST localhost:9200/_bulk?pretty=true --data-binary '
{ "index" : { "_index" : "parent_child", "_type" : "store", "_id" : "store1" } }
{ "name" : "auchan", "owner" : "chris" }
{ "index" : { "_index" : "parent_child", "_type" : "department", "_id" : "department1", "parent" : "store1" } }
{ "name" : "toys", "numberOfProducts" : 150 }
{ "index" : { "_index" : "parent_child", "_type" : "product", "_id" : "product1", "parent" : "department1", "routing" : "store1" } }
{ "name" : "gun", "trademark" : "tiger", "price" : 9, "store_id" : "store1" }
'
@demirhanaydin
demirhanaydin / tire-parent-child-example.rb
Last active December 22, 2015 23:48
Elasticsearch parent/child example with tire
require 'rubygems'
require 'tire'
Tire.configure { logger 'elasticsearch.log', :level => 'debug' }
class Document
attr_accessor :title, :content
include Tire::Model::Persistence
include Tire::Model::Search
include Tire::Model::Callbacks
#ifndef WIN32_NO_STATUS
# define WIN32_NO_STATUS
#endif
#include <windows.h>
#include <assert.h>
#include <stdio.h>
#include <winerror.h>
#include <winternl.h>
#include <stddef.h>
#include <winnt.h>