Would like to know whether term query support two separate letters as i
can't find it in the document of any indication (if not any alternative as
i need exact word matching). I have the following query :
{ "query": {
"filtered" : {*
"query" : {*
"term" : {*
"USER_ID" : "2"*
}*
},*
"filter" : { *
"bool" : {*
"must" : [*
{ "term" : { "CAT_ID" : "131"}},
//ContentType *
{ "term" : { "CAT_NAME" : "latest games"}}
//Genre *
]*
} *
}*
}*
}* }
and it doesn't return result however if the cat_name was latest then it
return.
Term queries terms are not analyzed, so they work best against fields that
are not analyzed. If you did not specify the CAT_NAME field as not_analyzed
(or used a keyword analyzer), then the standard analyzer will be used and
the value will be split in multiple tokens. Change the mapping for that
field to be not_analyzed and re-index your content.
Would like to know whether term query support two separate letters as i
can't find it in the document of any indication (if not any alternative as
i need exact word matching). I have the following query :
{ "query": {
"filtered" : {*
"query" : {*
"term" : {*
"USER_ID" : "2"*
}*
},*
"filter" : { *
"bool" : {*
"must" : [*
{ "term" : { "CAT_ID" : "131"}},
//ContentType *
{ "term" : { "CAT_NAME" : "latest games"}}
//Genre *
]*
} *
}*
}*
}* }
and it doesn't return result however if the cat_name was latest then it
return.
I add to Ivan's answer that for you use case as you query your term with lower case, you should use a keyword tokenizer + a lowercase filter in a custom analyzer and apply it to your field as described by Ivan.
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 5 août 2013 à 07:26, Ivan Brusic ivan@brusic.com a écrit :
Term queries terms are not analyzed, so they work best against fields that are not analyzed. If you did not specify the CAT_NAME field as not_analyzed (or used a keyword analyzer), then the standard analyzer will be used and the value will be split in multiple tokens. Change the mapping for that field to be not_analyzed and re-index your content.
Would like to know whether term query support two separate letters as i can't find it in the document of any indication (if not any alternative as i need exact word matching). I have the following query :
I not sure whether the ignore_conflicts parameter is in the right place or
not. But anyway with or without it still it will produce errors : {
"error": "MergeMappingException[Merge failed with failures {[mapper
[message] has different index values, mapper [message] has different
tokenize values, mapper [message] has different index_analyzer]}]",
"status": 400
}
Thanks.
Cyril
On Mon, Aug 5, 2013 at 1:26 PM, Ivan Brusic ivan@brusic.com wrote:
Term queries terms are not analyzed, so they work best against fields that
are not analyzed. If you did not specify the CAT_NAME field as not_analyzed
(or used a keyword analyzer), then the standard analyzer will be used and
the value will be split in multiple tokens. Change the mapping for that
field to be not_analyzed and re-index your content.
Would like to know whether term query support two separate letters as i
can't find it in the document of any indication (if not any alternative as
i need exact word matching). I have the following query :
{ "query": {
"filtered" : {*
"query" : {*
"term" : {*
"USER_ID" : "2"*
}*
},*
"filter" : { *
"bool" : {*
"must" : [*
{ "term" : { "CAT_ID" : "131"}},
//ContentType *
{ "term" : { "CAT_NAME" : "latest games"}}
//Genre *
]*
} *
}*
}*
}* }
and it doesn't return result however if the cat_name was latest then it
return.
--
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+unsubscribe@googlegroups.com.
I not sure whether the ignore_conflicts parameter is in the right place or not. But anyway with or without it still it will produce errors : {
"error": "MergeMappingException[Merge failed with failures {[mapper [message] has different index values, mapper [message] has different tokenize values, mapper [message] has different index_analyzer]}]",
"status": 400
}
Thanks.
Cyril
On Mon, Aug 5, 2013 at 1:26 PM, Ivan Brusic ivan@brusic.com wrote:
Term queries terms are not analyzed, so they work best against fields that are not analyzed. If you did not specify the CAT_NAME field as not_analyzed (or used a keyword analyzer), then the standard analyzer will be used and the value will be split in multiple tokens. Change the mapping for that field to be not_analyzed and re-index your content.
Would like to know whether term query support two separate letters as i can't find it in the document of any indication (if not any alternative as i need exact word matching). I have the following 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 elasticsearch+unsubscribe@googlegroups.com.
Thanks. But i m not gonna remove it cause that been administrate by the
another guy. In spite of that i could achieve what i wanted with the
following query :
{ "query": {
"filtered" : {*
"query" : {*
"term" : {*
"USER_ID" : "2"*
}*
},*
"filter" : { *
"query" : { *
"bool" : {*
"must" : [*
{ "term" : { "CAT_ID" : "131"}}, *
{ "match" : { "CAT_NAME" : { "query" :
"Top 10", "operator" : "and" }}} *
]*
} *
}*
}*
}*
}* }
Any shortcoming you could foresee ? Thanks anyway enlightenment on the
mapping.
Cyril
On Mon, Aug 5, 2013 at 4:31 PM, David Pilato david@pilato.fr wrote:
You can not update your mapping.
Remove the old one. It will remove your docs BTW.
And create a new one.
HTH
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
I not sure whether the ignore_conflicts parameter is in the right place or
not. But anyway with or without it still it will produce errors : {
"error": "MergeMappingException[Merge failed with failures {[mapper
[message] has different index values, mapper [message] has different
tokenize values, mapper [message] has different index_analyzer]}]",
"status": 400
}
Thanks.
Cyril
On Mon, Aug 5, 2013 at 1:26 PM, Ivan Brusic ivan@brusic.com wrote:
Term queries terms are not analyzed, so they work best against fields
that are not analyzed. If you did not specify the CAT_NAME field as
not_analyzed (or used a keyword analyzer), then the standard analyzer will
be used and the value will be split in multiple tokens. Change the mapping
for that field to be not_analyzed and re-index your content.
Would like to know whether term query support two separate letters as i
can't find it in the document of any indication (if not any alternative as
i need exact word matching). I have the following query :
{ "query": {
"filtered" : {*
"query" : {*
"term" : {*
"USER_ID" : "2"*
}*
},*
"filter" : { *
"bool" : {*
"must" : [*
{ "term" : { "CAT_ID" : "131"}},
//ContentType *
{ "term" : { "CAT_NAME" : "latest games"}}
//Genre *
]*
} *
}*
}*
}* }
and it doesn't return result however if the cat_name was latest then it
return.
--
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+unsubscribe@googlegroups.com.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.