Skip to content

Instantly share code, notes, and snippets.

View wizidot's full-sized avatar

Rom1Gar wizidot

  • france, aix en provence
View GitHub Profile
@wizidot
wizidot / facets or not ?
Created March 15, 2011 16:05
my mapping
I've got to update my mapping with this 3 new fields.
and i'm wonder if is enhance for facets ?
thanks.
curl -XPOST localhost:9200/places -d '{
"mappings" : {
"place" : {
"properties" : {
@wizidot
wizidot / gist:871369
Created March 15, 2011 20:17
analyze bug ?
curl -XGET 'localhost:9200/places/_analyze?analyzer=default' -d 'garage automobiles de france'
{"tokens":
[{"token":"garag","start_offset":0,"end_offset":6,"type":"word","position":1},
{"token":"automobil","start_offset":7,"end_offset":18,"type":"word","position":2},
{"token":"de","start_offset":19,"end_offset":21,"type":"word","position":3},
{"token":"franc","start_offset":22,"end_offset":28,"type":"word","position":4}]
}
/*** elasticsearch.yml **/
{"LEADID":"351877000000048133","SMOWNERID":"351877000000040003","name":"B COLLETTE HOLDING","TEL":"04 75 25 12 84","created":"2011-03-05 09:47:25","modified":"2011-03-05 09:47:25","ADRESSE":"Peyrambert","CITY":"CREST","CP":"26400","RUBRIQUE_PROFESSIONNELLE":"Activit\ufffds des soci\ufffdt\ufffds holding","CODE_NAF":"6420Z","location":"44.710905,5.0108645"}
@wizidot
wizidot / gist:876335
Created March 18, 2011 16:05
simple search term
This is my analyzer configuration :
index:
analysis:
analyzer:
default:
type: custom
tokenizer: whitespace
filter:[standard, lowercase, snowball]
motcle:
tokenizer: keyword
@wizidot
wizidot / gist:876447
Created March 18, 2011 17:10
curl recreation
define analyzer ?maybe is better to define inside the mapping...
index:
analysis:
analyzer:
default:
type: custom
tokenizer: whitespace
filter:[standard, lowercase, snowball]
motcle:
curl -XPUT localhost:9200/places -d '{
"settings" : {
"index" : {
"analysis" : {
"default" : {
"type" : "custom",
"tokenizer" : "whitespace",
"filter" : ["standard", "lowercase", "snowball"]
},
"motcle":{
@wizidot
wizidot / gist:876945
Created March 18, 2011 22:10
my gist
root@www:~# curl -XDELETE 'http://localhost:9200/places/'
{"error":"IndexMissingException[[places] missing]","status":404}root@www:~# ^C
root@www:~# curl -XPUT localhost:9200/places -d '{
> "settings" : {
> "index" : {
> "analysis" : {
> "analyzer" : {
> "default" : {
> "type" : "custom",
> "tokenizer" : "whitespace",
@wizidot
wizidot / gist:879524
Created March 21, 2011 14:29
hook library
inside MYMODULE.info :
/**
* Implements hook_library().
*/
function MYMODULE_library(){
$libraries=array();
// UI checkbox
$libraries['ui.checkbox'] = array(
'title' => 'jQuery UI: Checkbox',
creation of the index :
curl -XPUT localhost:9200/places -d '{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
"default" : {
"type" : "custom",
"tokenizer" : "whitespace",
past this json object here : http://www.jsonlint.com/
{
"took": 7,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},