Created
September 25, 2014 21:38
-
-
Save jlpoveda/eb3a4dd55a11f8c1a7a8 to your computer and use it in GitHub Desktop.
Algunas pruebas con Elasticsearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT /ofertix/campanya_producto/3 | |
{ | |
"nombre": "Zapatos 3", | |
"campanya_id": "3725", | |
"habilitado": "1", | |
"categoria": { | |
"1": "Actual", | |
"2": "Hombre", | |
"3": "Calzado", | |
"4": "Deportivo" | |
} | |
} | |
GET /ofertix/campanya_producto/_search | |
{ | |
"_source": "categoria.4", | |
"query": { | |
"terms": { | |
"categoria": ["Calzado"], | |
"minimum_should_match" : 1 | |
} | |
} | |
} | |
GET /ofertix/campanya_producto/_search | |
{ | |
"_source": "categoria.4", | |
"query": { | |
"bool": { | |
"should": [ | |
{ "match": { "categoria.1": "Actual" }}, | |
{ "match": { "categoria.4": "Elegante" }} | |
], | |
"minimum_should_match": 2 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment