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 <thib...@1001pharmacies.com> 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" >> } >> }, >> { >> "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/2ced6dc5-fa42-43bd-81bf-99ce4f7bedb5%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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/D2E34C22-B69E-43AD-A1FD-4773B9C6F35C%40pilato.fr. For more options, visit https://groups.google.com/d/optout.