Start a new index (delete the old one).
Index again your documents.
After that curl
curl -XPUT "http://localhost:9200/test/type1/_mapping" -d '
{
"properties" : {
"Params_1" : {"type" : "string", "index" : "not_analyzed"},
"Articul" : {"type" : "integer"}
}
}
'
I insert new value that query i use
curl -XPOST localhost:9200/test/type3/368800 -d '{"Articul":"1","Names":"Sample 1","Price":"1232","Cat":"1","Params_1":"text"}'
curl -XPOST localhost:9200/test/type3/368801 -d '{"Articul":"7","Names":"Sample 2","Price":"1234","Cat":"1","Params_1":"more mored text"}'
curl -XPOST localhost:9200/test/type3/368802 -d '{"Articul":"10","Names":"Sample 3","Price":"124323","Cat":"2","Params_1":"more text"}'
when i add new record, i use that curl query
curl -X POST "http://localhost:9200/test/type1/_search?pretty=true" -d '
{
"query" : {
"match_all" : { }
},
"sort" : [
{"Articul" : {"order" : "asc", "mode" : "avg"}}
],
"facets" : {
"tag" : {
"terms" : {
"field" : "Params_1"
}
}
}
}
'
and esatic return ordered records 1,10,7 rather than 1, 7, 10 and return facets terms
"facets" : {
"tag" : {
"_type" : "terms",
"missing" : 0,
"total" : 3151716,
"other" : 0,
"terms" : [ {
"term" : "texts",
"count" : 1050572
}, {
"term" : "text",
"count" : 525286
}, {
"term" : "more",
"count" : 525286
}, {
"term" : "mores",
"count" : 525286
}
]
}
}
среда, 18 сентября 2013 г., 1:33:19 UTC+3 пользователь David Pilato написал:
Start a new index (delete the old one).
Index again your documents.
Check logs.
If it does not work, please provide a full curl recreation. It will hep to understand what you are exactly doing.
See Elasticsearch Platform — Find real-time answers at scale | Elastic
--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs
Le 18 sept. 2013 à 00:25, Pashkevich Aleksandr serio...@gmail.com a écrit :
i try that query
$comand =' curl -XPUT "http://localhost:9200/test/type1/_mapping" -d '
{
"properties" : {
"Params_1" : {
"type" : "string",
"store" : "yes",
"index" : "not_analyzed",
"null_value" : "na"
}
}
}
and elastic return
{"ok":true,"acknowledged":true}
then i run my query and elastic return the same result
"facets" : {"tag" : {"_type" : "terms","missing" : 0,"total" : 3151716,"other" : 0,"terms" : [
{"term" : "mores","count" : 525286}, {"term" : "more","count" : 525286}, {"term" : "text","count" : 525286}, {"term" : "texts","count" : 1050572} ]}}
среда, 18 сентября 2013 г., 1:02:16 UTC+3 пользователь David Pilato написал:
You don't have to change the query but the mapping.
Have a look at Put Mapping API: Elasticsearch Platform — Find real-time answers at scale | Elastic. Set your field Params_1 as not_analyzed (Elasticsearch Platform — Find real-time answers at scale | Elastic) and then run again the same query.
Hope this helps
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs
Le 17 sept. 2013 à 23:14, Pashkevich Aleksandr serio...@gmail.com a écrit :
Hello, sory for my English
i am use that query for get all fields of one tag
{
"query" : {
"match_all" : { }
},
"facets" : {
"Params_1" : {
"terms" : {
"field" : "Params_1",
}
}
}
}
and elasticsearch return to me result
"facets" : {"tag" : {"_type" : "terms","missing" : 0,"total" : 3151716,"other" : 0,"terms" : [
{"term" : "mores","count" : 525286}, {"term" : "more","count" : 525286}, {"term" : "text","count" : 525286}, {"term" : "texts","count" : 1050572} ]}}
All great, but one small trouble. Me need to return a full term, for example "more text", and don't return "more" and "text" as two different terms.
How i can change query?
--
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 elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.