Skip to content

Instantly share code, notes, and snippets.

View jsbonline2006's full-sized avatar

Jayesh Bhoyar jsbonline2006

  • Cognizant Technology Solutions Ltd
  • Pune
View GitHub Profile
@jsbonline2006
jsbonline2006 / morphline.conf
Last active August 29, 2015 14:13
Unable to index the xml file in cloudera solr using flume
# Specify server locations in a SOLR_LOCATOR variable; used later in variable substitutions:
SOLR_LOCATOR : {
# Name of solr collection
collection : SampleSearch
# ZooKeeper ensemble
zkHost : "host:port/solr"
}
morphlines : [
{
@jsbonline2006
jsbonline2006 / One Index 2 data type join query
Created February 27, 2014 03:44
One Index 2 data type join query
# delete old index if exists
curl -XDELETE 'http://localhost:9200/productindex?pretty'
# Create new Index productindex
curl -XPUT 'http://localhost:9200/productindex?pretty' -d '{}'
# Insert data in productindex for offertype
curl -XPUT 'http://localhost:9200/productindex/offertype/1?pretty' -d '{"skuid": "1983001", "offer_id": "promo00001,promo00002,promo00003"}'
curl -XPUT 'http://localhost:9200/productindex/offertype/2?pretty' -d '{"skuid": "1983002", "offer_id": "promo00001,promo00002"}'
curl -XPUT 'http://localhost:9200/productindex/offertype/3?pretty&refresh=true' -d '{"skuid": "1983003", "offer_id": "promo00001,promo00003"}'
@jsbonline2006
jsbonline2006 / Join two index
Created February 26, 2014 10:34
How to join 2 indexes at query time
# delete old index if exists
curl -XDELETE 'http://localhost:9200/offerindex?pretty'
curl -XDELETE 'http://localhost:9200/categoryindex?pretty'
# Create Index
curl -XPUT 'http://localhost:9200/offerindex?pretty' -d '{}'
curl -XPUT 'http://localhost:9200/categoryindex?pretty' -d '{}'
curl -XPUT 'http://localhost:9200/offerindex/offertype/1?pretty' -d '{"skuid": "1983001", "offer_id": "promo00001,promo00002,promo00003"}'
@jsbonline2006
jsbonline2006 / multi_word_synonyms
Last active August 29, 2015 13:56
Multi-word query time synonyms in elasticsearch.
# delete old index if exists
curl -XDELETE 'http://localhost:9200/syns?pretty'
# create index with synonym analyzer and mapping
curl -XPUT 'http://localhost:9200/syns?pretty' -d '{
"settings" : {
"number_of_replicas": 0,
"number_of_shards": 1,
"index": {
"analysis": {