Disable norming for a dynamic filed


(lep) #1

Hi,

what is the best way to disable norming for a dynamic object with put
mapping command
i was able to disable it for a specific filed name
"f1": {
"type": "string",
"store": "yes",
"index": "not_analyzed",
"omit_term_freq_and_positions" : true,
"omit_norms" : true,
"boost" : 1.0,
"term_vector" : "no"
}

but did not able to do it for a dynamic object

Thanks
-Lep


(Shay Banon) #2

Check dynamic templates here: http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html. Specifically, if you are looking to disable norms for string types under a specific object, see path_match.

On Monday, March 5, 2012 at 11:50 AM, lep wrote:

Hi,

what is the best way to disable norming for a dynamic object with put
mapping command
i was able to disable it for a specific filed name
"f1": {
"type": "string",
"store": "yes",
"index": "not_analyzed",
"omit_term_freq_and_positions" : true,
"omit_norms" : true,
"boost" : 1.0,
"term_vector" : "no"
}

but did not able to do it for a dynamic object

Thanks
-Lep


(lep) #3

Hi Shay,

I need to set a mapping in elasticsearch that include f1 a static
filed and change the default behaviour of es and also to have a
dynamic filed named object that has dynamic fields under it ( all the
fields need to "omit_norms" : true).

I have added my mapping ,I am still getting my object.f1 with norming
is my mapping is a valid mapping to get this type of behaviour.

Please Advice.

{
"data": {
"properties": {
"f1": {
"type": "string",
"store": "yes",
"index": "not_analyzed",
"omit_term_freq_and_positions" : true,
"omit_norms" : true,
"boost" : 1.0,
"term_vector" : "no"
},
"obj" : {
type : "object",
"dynamic_templates" : [
{
"generic_obj" : {

"match" : "*",

"mapping" : {
"omit_norms" : true
}
}
}
]
}

    }
}

}

On Mar 5, 5:27 pm, Shay Banon kim...@gmail.com wrote:

Check dynamic templates here:http://www.elasticsearch.org/guide/reference/mapping/root-object-type.... Specifically, if you are looking to disable norms for string types under a specific object, see path_match.

On Monday, March 5, 2012 at 11:50 AM, lep wrote:

Hi,

what is the best way to disable norming for a dynamic object with put
mapping command
i was able to disable it for a specific filed name
"f1": {
"type": "string",
"store": "yes",
"index": "not_analyzed",
"omit_term_freq_and_positions" : true,
"omit_norms" : true,
"boost" : 1.0,
"term_vector" : "no"
}

but did not able to do it for a dynamic object

Thanks
-Lep


(Shay Banon) #4

Your format is not correct, dynamic_templates need to be under the root type, see samples here: http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html.

On Sunday, March 11, 2012 at 4:36 PM, lep wrote:

{
"data": {
"properties": {
"f1": {
"type": "string",
"store": "yes",
"index": "not_analyzed",
"omit_term_freq_and_positions" : true,
"omit_norms" : true,
"boost" : 1.0,
"term_vector" : "no"
},
"obj" : {
type : "object",
"dynamic_templates" : [
{
"generic_obj" : {

"match" : "*",

"mapping" : {
"omit_norms" : true
}
}
}
]
}

}
}
}


(system) #5