Skip to content

Instantly share code, notes, and snippets.

View sanjay1688's full-sized avatar

Sanjay Sahu sanjay1688

View GitHub Profile
This is an example how to perform multi-select faceting in ElasticSearch.
Selecting multiple values from the same facet will result in an OR filter between each of the values:
(facet1.value1 OR facet1.value2)
Faceting on more than one facet will result in an AND filter between each facet:
(facet1.value1 OR facet1.value2) AND (facet2.value1)
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh).
#!/bin/sh
curl -XDELETE localhost:9200/foo >/dev/null
curl -XPOST localhost:9200/foo/t -d'
{
"clicks": 10,
"impressions": 1000,
"when": "2013-10-01"
}
@sanjay1688
sanjay1688 / ubuntu development software cmds
Last active November 22, 2016 10:26
Programming Software Commnd ( install, remove, services, dependencies ) Ubuntu Enviroment
############## UPDATE UBUNTU ##############
sudo local-gen UTF-8
sudo apt-get update
sudo apt-get upgrade
############## GIT ##############
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
@sanjay1688
sanjay1688 / ubuntu useful software cmds
Last active August 29, 2015 14:06
Useful Software Commnd ( install, remove, services, dependencies ) Ubuntu Enviroment
############## Chrome ##############
sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
Remove
sudo apt-get remove google-chrome-stable
sudo apt-get purge google-chrome-stable
sudo apt-get autoremove
@sanjay1688
sanjay1688 / monogdb commands
Last active August 12, 2016 10:36
Monogdb useful commonds
Service
sudo status mongodb //tell status of mongodb start or stop
sudo service mongodb restart | stop | start
Config
#bind_ip = 127.0.0.1 //comment it which so anyone can connect using mongo client
//copy db from one host to another host or in host
db.copyDatabase('from_db', 'to_db', 'from_hostname', 'username', 'password');
@sanjay1688
sanjay1688 / Elastic Search Command
Last active August 12, 2016 10:34
Elastic Search Command And Query Examples
curl -XDELETE http://domain:9200/index/type
http://domain/createmapping
http://domain/mongo2elastic/finder
################################################################################
FINDER SEARCH API
@sanjay1688
sanjay1688 / linux-cmds
Last active August 12, 2016 10:38
linux commands
################################# ALIAS ############################
To Make permanent add into
~/bashrc
To Make permanent global add into
/etc/bashrc
//create shortcuts
alias fit="cd /var/www/html/fit"
alias .="cd ../"
@sanjay1688
sanjay1688 / noode js stuffs
Last active August 29, 2015 14:08
Node Js Commands / Stuffs
Installtion of node and express
apt-get install libssl-dev
download node source code
wget http://nodejs.org/dist/v0.6.19/node-v0.6.19.tar.gz
tar -vxf node-v0.6.19.tar.gz
go inside source code dir after run configure and build source code and install
cd /node-v0.6.19
1) ./configure
2) make
3) sudo make install
@sanjay1688
sanjay1688 / Kraken.php
Created December 26, 2014 08:09
My code
// php upload function
Array
(
[file] => /tmp/phpRZl57f
[wait] => 1
[lossy] => 1
[s3_store] => Array
(
@sanjay1688
sanjay1688 / multi-git.md
Created September 30, 2015 13:40 — forked from fitsanju/multi-git.md
Setting up a Github and Bitbucket account on the same computer.

Setting up github and bitbucket on the same computer

Github will be the main account and bitbucket the secondary.

Create SSH Keys

ssh-keygen -t rsa -C "github email"

Enter passphrase when prompted. If you see an option to save the passphrase in your keychain, do it for an easier life.