Re: need help for search

2015-01-15 Thread Thibaut Owczarz
Thanks for elastisearch-fr mailing list

tomorrow I do a little game simple data
and I give the request that I want to do and the result i need

Thanks


Le jeudi 15 janvier 2015 17:31:28 UTC+1, David Pilato a écrit :
>
> No worries for your english.
> Sorry. I missed your gist.
>
> Based on your examples, it sounds like you are french. Are you aware of 
> the french mailing list? 
> https://groups.google.com/forum/?hl=fr&fromgroups#!forum/elasticsearch-fr
>
> It would help a lot if you can simplify with some sample data and small 
> queries what you are trying to do what does not work.
> So suppress all analyzers as I guess here it’s not really your concern at 
> this stage.
> Try with only two or 3 fields.
>
>
> -- 
> *David Pilato* | *Technical Advocate* | *Elasticsearch.com 
> *
> @dadoonet  | @elasticsearchfr 
>  | @scrutmydocs 
> 
>
>
>  
> Le 15 janv. 2015 à 17:13, Thibaut Owczarz  > a écrit :
>
> hi,
>
> in my structure send in my gist,
> my question is just that:
>
> i have a search field. no say what i type in this field.
> but i need 1 request like this.
> {
> "query" : {
> "bool": {
> "must": [ ],
> "must_not": [ ],
> "should": [
> {
> "term": {
> "sku": $datasearch
> }
> },
> {
> "term": {
>"internal_code": $datasearch
> }
> },
> {
> "match": {
>"firstname": $datasearch
> }
> },
> {
> "match": {
>"lastname": $datasearch
> }
> },
> {
> "match": {
>"address": $datasearch
> }
> },
> {
> "match": {
>"city": $datasearch
> }
> },   
> {
> "match": {
>"localized_description": $datasearch
> }
> },   
> {
> "match": {
>"localized_keywords": $datasearch
> }
> },
> {
> "match": {
>"service.localized_label": $datasearch
> }
> },
> {
> "match": {
>"medias.localized_label": $datasearch
> }
> },
> {
> "match": {
>"services.localized_label": $datasearch
> }
> }
> ]
> }
> }
> }';
>
> Exemple :
> -
> - if $datasearch=sku, i have directly 1 user with this sku
> - if $datasearch=firstname, i have directly a list of user who have this 
> firstname
> - if $datasearch=keyword, i have list of user who have this keyword
>
> - i take term for sku or internal_code because i can't search whith 
> partial of this. (if my sku = 1234, no could found result if i type 123)
>
> - And for finish, in my data i have user : 
> [1 - charles martin who have localized_keywords="moto, licorne, cheval, 
> course" ] 
> [2 - henry martin who have localized_keywords="pétanque, chevaux, basket, 
> parieur"]
> i want with my request have this 2 user if $datasearch = cheval.
>
> I hope to be me understand , I can have a bad English
>
>
> thanks
>
>
> Le jeudi 15 janvier 2015 16:17:08 UTC+1, David Pilato a écrit :
>
> Could you reproduce this with a full test case so we understand exactly 
> What you are doing?
> May be simplify your test.
>
> See elasticsearch.org/help
>
>
> --
> David ;-)
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>
> Le 15 janv. 2015 à 16:01, Thibaut Owczarz  a 
> écrit :
>
> i'm ok, but my data search no say if is sku or code_internal or other 
> field.
>
> if i do that, it's ok
> {
>   "query": {
> "bool": {
>   "must": [
> {
>   "term": {
> "sku": "01b3ae496c0142f993cf131c607fe003"
>   }
> }
>   ],
>   "must_not": [],
>   "should": [
>   {
>
> "term": {
>"internal_code": "01b3ae496c0142f993cf131c607fe003"
> }
>  },
>
> {
>   "match": {
> "firstname": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "lastname": "01b3ae496c0142f993cf131c607fe003"
>

Re: need help for search

2015-01-15 Thread David Pilato
No worries for your english.
Sorry. I missed your gist.

Based on your examples, it sounds like you are french. Are you aware of the 
french mailing list? 
https://groups.google.com/forum/?hl=fr&fromgroups#!forum/elasticsearch-fr 


It would help a lot if you can simplify with some sample data and small queries 
what you are trying to do what does not work.
So suppress all analyzers as I guess here it’s not really your concern at this 
stage.
Try with only two or 3 fields.


-- 
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet  | @elasticsearchfr 
 | @scrutmydocs 




> Le 15 janv. 2015 à 17:13, Thibaut Owczarz  a 
> écrit :
> 
> hi,
> 
> in my structure send in my gist,
> my question is just that:
> 
> i have a search field. no say what i type in this field.
> but i need 1 request like this.
> {
> "query" : {
> "bool": {
> "must": [ ],
> "must_not": [ ],
> "should": [
> {
> "term": {
> "sku": $datasearch
> }
> },
> {
> "term": {
>"internal_code": $datasearch
> }
> },
> {
> "match": {
>"firstname": $datasearch
> }
> },
> {
> "match": {
>"lastname": $datasearch
> }
> },
> {
> "match": {
>"address": $datasearch
> }
> },
> {
> "match": {
>"city": $datasearch
> }
> },   
> {
> "match": {
>"localized_description": $datasearch
> }
> },   
> {
> "match": {
>"localized_keywords": $datasearch
> }
> },
> {
> "match": {
>"service.localized_label": $datasearch
> }
> },
> {
> "match": {
>"medias.localized_label": $datasearch
> }
> },
> {
> "match": {
>"services.localized_label": $datasearch
> }
> }
> ]
> }
> }
> }';
> 
> Exemple :
> -
> - if $datasearch=sku, i have directly 1 user with this sku
> - if $datasearch=firstname, i have directly a list of user who have this 
> firstname
> - if $datasearch=keyword, i have list of user who have this keyword
> 
> - i take term for sku or internal_code because i can't search whith partial 
> of this. (if my sku = 1234, no could found result if i type 123)
> 
> - And for finish, in my data i have user : 
> [1 - charles martin who have localized_keywords="moto, licorne, cheval, 
> course" ] 
> [2 - henry martin who have localized_keywords="pétanque, chevaux, basket, 
> parieur"]
> i want with my request have this 2 user if $datasearch = cheval.
> 
> I hope to be me understand , I can have a bad English
> 
> thanks
> 
> Le jeudi 15 janvier 2015 16:17:08 UTC+1, David Pilato a écrit :
> Could you reproduce this with a full test case so we understand exactly What 
> you are doing?
> May be simplify your test.
> 
> See elasticsearch.org/help 
> 
> 
> --
> David ;-)
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 15 janv. 2015 à 16:01, Thibaut Owczarz  > a écrit :
> 
>> i'm ok, but my data search no say if is sku or code_internal or other field.
>> 
>> if i do that, it's ok
>> {
>>   "query": {
>> "bool": {
>>   "must": [
>> {
>>   "term": {
>> "sku": "01b3ae496c0142f993cf131c607fe003"
>>   }
>> }
>>   ],
>>   "must_not": [],
>>   "should": [
>>   {
>>> "term": {
>>>"internal_code": "01b3ae496c0142f993cf131c607fe003"
>>> }
>>>  },
>> 
>> {
>>   "match": {
>> "firstname": "01b3ae496c0142f993cf131c607fe003"
>>   }
>> },
>> {
>>   "match": {
>> "lastname": "01b3ae496c0142f993cf131c607fe003"
>>   }
>> },
>> {
>>   "match": {
>> "address": "01b3ae496c0142f993cf131c607fe003"
>>   }
>> 

Re: need help for search

2015-01-15 Thread Thibaut Owczarz
hi,

in my structure send in my gist,
my question is just that:

i have a search field. no say what i type in this field.
but i need 1 request like this.
{
"query" : {
"bool": {
"must": [ ],
"must_not": [ ],
"should": [
{
"term": {
"sku": $datasearch
}
},
{
"term": {
   "internal_code": $datasearch
}
},
{
"match": {
   "firstname": $datasearch
}
},
{
"match": {
   "lastname": $datasearch
}
},
{
"match": {
   "address": $datasearch
}
},
{
"match": {
   "city": $datasearch
}
},   
{
"match": {
   "localized_description": $datasearch
}
},   
{
"match": {
   "localized_keywords": $datasearch
}
},
{
"match": {
   "service.localized_label": $datasearch
}
},
{
"match": {
   "medias.localized_label": $datasearch
}
},
{
"match": {
   "services.localized_label": $datasearch
}
}
]
}
}
}';

Exemple :
-
- if $datasearch=sku, i have directly 1 user with this sku
- if $datasearch=firstname, i have directly a list of user who have this 
firstname
- if $datasearch=keyword, i have list of user who have this keyword

- i take term for sku or internal_code because i can't search whith partial 
of this. (if my sku = 1234, no could found result if i type 123)

- And for finish, in my data i have user : 
[1 - charles martin who have localized_keywords="moto, licorne, cheval, 
course" ] 
[2 - henry martin who have localized_keywords="pétanque, chevaux, basket, 
parieur"]
i want with my request have this 2 user if $datasearch = cheval.

I hope to be me understand , I can have a bad English


thanks


Le jeudi 15 janvier 2015 16:17:08 UTC+1, David Pilato a écrit :
>
> Could you reproduce this with a full test case so we understand exactly 
> What you are doing?
> May be simplify your test.
>
> See elasticsearch.org/help
>
>
> --
> David ;-)
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>
> Le 15 janv. 2015 à 16:01, Thibaut Owczarz  > a écrit :
>
> i'm ok, but my data search no say if is sku or code_internal or other 
> field.
>
> if i do that, it's ok
> {
>   "query": {
> "bool": {
>   "must": [
> {
>   "term": {
> "sku": "01b3ae496c0142f993cf131c607fe003"
>   }
> }
>   ],
>   "must_not": [],
>   "should": [
>   {
>
> "term": {
>"internal_code": "01b3ae496c0142f993cf131c607fe003"
> }
>  },
>
> {
>   "match": {
> "firstname": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "lastname": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "address": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "city": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "localized_description": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "localized_keywords": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "service.localized_label": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "medias.localized_label": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "services.localized_label": "01b3ae496c0142f993cf131c607fe003"
>   }
> }
>   ]
> }
>   }
> }
>
> but if now i search with internal_code
> {
>   "query": {
> "bool": {
>   "must": [
> {
>   "term": {
> "sku": "3401598272746"
>   }
> }
>   ],
>   "must_not": [],
>   "should": [
> 

Re: need help for search

2015-01-15 Thread David Pilato
Could you reproduce this with a full test case so we understand exactly What 
you are doing?
May be simplify your test.

See elasticsearch.org/help


--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 15 janv. 2015 à 16:01, Thibaut Owczarz  a 
> écrit :
> 
> i'm ok, but my data search no say if is sku or code_internal or other field.
> 
> if i do that, it's ok
> {
>   "query": {
> "bool": {
>   "must": [
> {
>   "term": {
> "sku": "01b3ae496c0142f993cf131c607fe003"
>   }
> }
>   ],
>   "must_not": [],
>   "should": [
>   {
>> "term": {
>>"internal_code": "01b3ae496c0142f993cf131c607fe003"
>> }
>>  },
> 
> {
>   "match": {
> "firstname": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "lastname": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "address": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "city": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "localized_description": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "localized_keywords": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "service.localized_label": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "medias.localized_label": "01b3ae496c0142f993cf131c607fe003"
>   }
> },
> {
>   "match": {
> "services.localized_label": "01b3ae496c0142f993cf131c607fe003"
>   }
> }
>   ]
> }
>   }
> }
> 
> but if now i search with internal_code
> {
>   "query": {
> "bool": {
>   "must": [
> {
>   "term": {
> "sku": "3401598272746"
>   }
> }
>   ],
>   "must_not": [],
>   "should": [
>   {
>> "term": {
>>"internal_code": "3401598272746"
>> }
>>  },
> 
> {
>   "match": {
> "firstname": "3401598272746"
>   }
> },
> {
>   "match": {
> "lastname": "3401598272746"
>   }
> },
> {
>   "match": {
> "address": "3401598272746"
>   }
> },
> {
>   "match": {
> "city": "3401598272746"
>   }
> },
> {
>   "match": {
> "localized_description": "3401598272746"
>   }
> },
> {
>   "match": {
> "localized_keywords": "3401598272746"
>   }
> },
> {
>   "match": {
> "service.localized_label": "3401598272746"
>   }
> },
> {
>   "match": {
> "medias.localized_label": "3401598272746"
>   }
> },
> {
>   "match": {
> "services.localized_label": "3401598272746"
>   }
> }
>   ]
> }
>   }
> }
> my request is bad
> 
> 
> Le jeudi 15 janvier 2015 15:49:56 UTC+1, David Pilato a écrit :
>> 
>> I guess it's most likely because you added all your filters in should clause 
>> instead of must?
>> 
>> --
>> David ;-)
>> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>> 
>>> Le 15 janv. 2015 à 15:36, Thibaut Owczarz  a 
>>> écrit :
>>> 
>>> i found my first error, no need user. because i search already in user.
>>> but why when i search a defined sku, no found only one ?
>>> 
>>> 
>>> curl -XPOST 'http://localhost:9200/test_fr/user/_search' -d '{
>>> "query" : {
>>> "bool": {
>>> "must": [ ],
>>> "must_not": [ ],
>>> "should": [
>>> {
>>> "term": {
>>> "sku": "01b3ae496c0142f993cf131c607fe003"
>>> }
>>> },
>>> {
>>> "term": {
>>>"internal_code": "01b3ae496c0142f993cf131c607fe003"
>>> }
>>> },
>>> {
>>> "match": {
>>>"firstname": "01b3ae496c0142f993cf131c607fe003"
>>> }
>>> },
>>> {
>>> "match": {
>>>"lastname": "01b3ae496c0142f993cf131c607fe003"
>>> }
>>> },
>>> {
>>> "match": {
>>>"address": "01b3ae496c0142f993cf131c607fe003"
>>> }
>>> },   

Re: need help for search

2015-01-15 Thread Thibaut Owczarz
i'm ok, but my data search no say if is sku or code_internal or other field.

if i do that, it's ok
{
  "query": {
"bool": {
  "must": [
{
  "term": {
"sku": "01b3ae496c0142f993cf131c607fe003"
  }
}
  ],
  "must_not": [],
  "should": [
  {

"term": {
   "internal_code": "01b3ae496c0142f993cf131c607fe003"
}
 },

{
  "match": {
"firstname": "01b3ae496c0142f993cf131c607fe003"
  }
},
{
  "match": {
"lastname": "01b3ae496c0142f993cf131c607fe003"
  }
},
{
  "match": {
"address": "01b3ae496c0142f993cf131c607fe003"
  }
},
{
  "match": {
"city": "01b3ae496c0142f993cf131c607fe003"
  }
},
{
  "match": {
"localized_description": "01b3ae496c0142f993cf131c607fe003"
  }
},
{
  "match": {
"localized_keywords": "01b3ae496c0142f993cf131c607fe003"
  }
},
{
  "match": {
"service.localized_label": "01b3ae496c0142f993cf131c607fe003"
  }
},
{
  "match": {
"medias.localized_label": "01b3ae496c0142f993cf131c607fe003"
  }
},
{
  "match": {
"services.localized_label": "01b3ae496c0142f993cf131c607fe003"
  }
}
  ]
}
  }
}

but if now i search with internal_code
{
  "query": {
"bool": {
  "must": [
{
  "term": {
"sku": "3401598272746"
  }
}
  ],
  "must_not": [],
  "should": [
  {

"term": {
   "internal_code": "3401598272746"

}
 },

{
  "match": {
"firstname": "3401598272746"
  }
},
{
  "match": {
"lastname": "3401598272746"
  }
},
{
  "match": {
"address": "3401598272746"
  }
},
{
  "match": {
"city": "3401598272746"
  }
},
{
  "match": {
"localized_description": "3401598272746"
  }
},
{
  "match": {
"localized_keywords": "3401598272746"
  }
},
{
  "match": {
"service.localized_label": "3401598272746"
  }
},
{
  "match": {
"medias.localized_label": "3401598272746"
  }
},
{
  "match": {
"services.localized_label": "3401598272746"
  }
}
  ]
}
  }
}
my request is bad


Le jeudi 15 janvier 2015 15:49:56 UTC+1, David Pilato a écrit :
>
> I guess it's most likely because you added all your filters in should 
> clause instead of must?
>
> --
> David ;-)
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>
> Le 15 janv. 2015 à 15:36, Thibaut Owczarz  > a écrit :
>
> i found my first error, no need user. because i search already in user.
> but why when i search a defined sku, no found only one ?
>
>
> curl -XPOST 'http://localhost:9200/test_fr/user/_search' -d '{
> "query" : {
> "bool": {
> "must": [ ],
> "must_not": [ ],
> "should": [
> {
> "term": {
> "sku": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "term": {
>"internal_code": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"firstname": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"lastname": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"address": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"city": "01b3ae496c0142f993cf131c607fe003"
> }
> },   
> {
> "match": {
>"localized_description": 
> "01b3ae496c0142f993cf131c607fe003"
> }
> },   
> {
> "match": {
>"localized_keywords": 
> "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>

Re: need help for search

2015-01-15 Thread David Pilato
I guess it's most likely because you added all your filters in should clause 
instead of must?

--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 15 janv. 2015 à 15:36, Thibaut Owczarz  a 
> écrit :
> 
> i found my first error, no need user. because i search already in user.
> but why when i search a defined sku, no found only one ?
> 
> 
> curl -XPOST 'http://localhost:9200/test_fr/user/_search' -d '{
> "query" : {
> "bool": {
> "must": [ ],
> "must_not": [ ],
> "should": [
> {
> "term": {
> "sku": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "term": {
>"internal_code": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"firstname": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"lastname": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"address": "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"city": "01b3ae496c0142f993cf131c607fe003"
> }
> },   
> {
> "match": {
>"localized_description": 
> "01b3ae496c0142f993cf131c607fe003"
> }
> },   
> {
> "match": {
>"localized_keywords": 
> "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"service.localized_label": 
> "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"medias.localized_label": 
> "01b3ae496c0142f993cf131c607fe003"
> }
> },
> {
> "match": {
>"services.localized_label": 
> "01b3ae496c0142f993cf131c607fe003"
> }
> }
> ]
> }
> }
> }';
> 
> they return all my users.
> 
> Thanks
> 
> Le jeudi 15 janvier 2015 14:58:16 UTC+1, Thibaut Owczarz a écrit :
>> 
>> Hello,
>>  I start learning Elasticsearch, and i have a problem for understand how 
>> search. anyone could help me? 
>> 
>> My gist for all my structure and my data is here
>> https://gist.github.com/thibaut1001/7a3000c3ff371be3a52d
>> 
>> My problem is just in 4part
>> To search in multi field by data like this
>> 
>> ## We need to search henry in field selected
>> curl -XPOST 'http://localhost:9200/test_fr/user/_search' -d '{
>> "query" : {
>> "bool": {
>> "must": [ ],
>> "must_not": [ ],
>> "should": [
>> {
>> "term": {
>> "user.sku": "henry"
>> }
>> },
>> {
>> "term": {
>>"user.internal_code": "henry"
>> }
>> },
>> {
>> "term": {
>>"user.firstname": "henry"
>> }
>> },
>> {
>> "term": {
>>"user.lastname": "henry"
>> }
>> },
>> {
>> "term": {
>>"user.address": "henry"
>> }
>> },
>> {
>> "term": {
>>"user.city": "henry"
>> }
>> },
>> {
>> "term": {
>>"user.localized_description": "henry"
>> }
>> },
>> {
>> "term": {
>>"user.localized_keywords": "henry"
>> }
>> },
>> {
>> "term": {
>>"user.service.localized_label": "henry"
>> }
>> },
>> {
>> "term": {
>>"user.medias.localized_label": "henry"
>> }
>> },
>>

Re: need help for search

2015-01-15 Thread Thibaut Owczarz
i found my first error, no need user. because i search already in user.
but why when i search a defined sku, no found only one ?


curl -XPOST 'http://localhost:9200/test_fr/user/_search' -d '{
"query" : {
"bool": {
"must": [ ],
"must_not": [ ],
"should": [
{
"term": {
"sku": "01b3ae496c0142f993cf131c607fe003"
}
},
{
"term": {
   "internal_code": "01b3ae496c0142f993cf131c607fe003"
}
},
{
"match": {
   "firstname": "01b3ae496c0142f993cf131c607fe003"
}
},
{
"match": {
   "lastname": "01b3ae496c0142f993cf131c607fe003"
}
},
{
"match": {
   "address": "01b3ae496c0142f993cf131c607fe003"
}
},
{
"match": {
   "city": "01b3ae496c0142f993cf131c607fe003"
}
},   
{
"match": {
   "localized_description": 
"01b3ae496c0142f993cf131c607fe003"
}
},   
{
"match": {
   "localized_keywords": 
"01b3ae496c0142f993cf131c607fe003"
}
},
{
"match": {
   "service.localized_label": 
"01b3ae496c0142f993cf131c607fe003"
}
},
{
"match": {
   "medias.localized_label": 
"01b3ae496c0142f993cf131c607fe003"
}
},
{
"match": {
   "services.localized_label": 
"01b3ae496c0142f993cf131c607fe003"
}
}
]
}
}
}';

they return all my users.

Thanks

Le jeudi 15 janvier 2015 14:58:16 UTC+1, Thibaut Owczarz a écrit :
>
> Hello,
>  I start learning Elasticsearch, and i have a problem for understand how 
> search. anyone could help me? 
>
> My gist for all my structure and my data is here
> https://gist.github.com/thibaut1001/7a3000c3ff371be3a52d
>
> My problem is just in 4part
> To search in multi field by data like this
>
>
> ## We need to search henry in field selected
> curl -XPOST 'http://localhost:9200/test_fr/user/_search' -d '{
> "query" : {
> "bool": {
> "must": [ ],
> "must_not": [ ],
> "should": [
> {
> "term": {
> "user.sku": "henry"
> }
> },
> {
> "term": {
>"user.internal_code": "henry"
> }
> },
> {
> "term": {
>"user.firstname": "henry"
> }
> },
> {
> "term": {
>"user.lastname": "henry"
> }
> },
> {
> "term": {
>"user.address": "henry"
> }
> },
> {
> "term": {
>"user.city": "henry"
> }
> },
> {
> "term": {
>"user.localized_description": "henry"
> }
> },
> {
> "term": {
>"user.localized_keywords": "henry"
> }
> },
> {
> "term": {
>"user.service.localized_label": "henry"
> }
> },
> {
> "term": {
>"user.medias.localized_label": "henry"
> }
> },
> {
> "term": {
>"user.services.localized_label": "henry"
> }
> }
> ]
> }
> }
> }';
>
> ## Return no results Why?
>
> I have many question.
> Could you help me please,
> thanks
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from

need help for search

2015-01-15 Thread Thibaut Owczarz
Hello,
 I start learning Elasticsearch, and i have a problem for understand how 
search. anyone could help me? 

My gist for all my structure and my data is here
https://gist.github.com/thibaut1001/7a3000c3ff371be3a52d

My problem is just in 4part
To search in multi field by data like this


## We need to search henry in field selected
curl -XPOST 'http://localhost:9200/test_fr/user/_search' -d '{
"query" : {
"bool": {
"must": [ ],
"must_not": [ ],
"should": [
{
"term": {
"user.sku": "henry"
}
},
{
"term": {
   "user.internal_code": "henry"
}
},
{
"term": {
   "user.firstname": "henry"
}
},
{
"term": {
   "user.lastname": "henry"
}
},
{
"term": {
   "user.address": "henry"
}
},
{
"term": {
   "user.city": "henry"
}
},
{
"term": {
   "user.localized_description": "henry"
}
},
{
"term": {
   "user.localized_keywords": "henry"
}
},
{
"term": {
   "user.service.localized_label": "henry"
}
},
{
"term": {
   "user.medias.localized_label": "henry"
}
},
{
"term": {
   "user.services.localized_label": "henry"
}
}
]
}
}
}';

## Return no results Why?

I have many question.
Could you help me please,
thanks

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/c32551bd-cd04-4227-b783-40ca556928f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.