Boost filed


(subhash) #1

Hi,

I have referred below link

http://www.elasticsearch.org/guide/reference/mapping/boost-field.html

Still I have doubt on the same.

Below is my scenario

Index is : employees

{

"settings": {"number_of_shards": 3, "number_of_replica": 0},

"mappings": {

"employee": {

  "_source": {"enabled": true},

  "properties": {"name": {"type": "string"},"surname": {"type": 

"string"},"phone": {"type": "string"}

} } } }

Now please help me how I can apply a boost level on surname.

I was trying below script, but is not working for me :frowning:

{

"settings": {"number_of_shards": 3, "number_of_replica": 0},

"mappings": {

"employee": {

  "_source": {"enabled": true},

"_boost": {"name": "*surname*","null_value": 2},

  "properties": {"name": {"type": "string"},"*surname*": {"type": 

"string"},"phone": {"type": "string"}

} } } }


(Ivan Brusic) #2

The _boost setting is used to indicate which field contains the value
to boost the score of the entire document. This field should be a
numerical value, not a string like surname.

What exactly are you trying to achieve? Are you trying to boost based
on the value the surname? If so, you can boost the field within your
indexing code or boost at query time
(http://www.elasticsearch.org/guide/reference/query-dsl/boosting-query.html),

--
Ivan

On Thu, Jul 19, 2012 at 3:56 AM, subhash mksubhashnambiar@gmail.com wrote:

Hi,

I have referred below link

http://www.elasticsearch.org/guide/reference/mapping/boost-field.html

Still I have doubt on the same.

Below is my scenario

Index is : employees

{

"settings": {"number_of_shards": 3, "number_of_replica": 0},

"mappings": {

"employee": {

  "_source": {"enabled": true},

  "properties": {"name": {"type": "string"},"surname": {"type":

"string"},"phone": {"type": "string"}

} } } }

Now please help me how I can apply a boost level on surname.

I was trying below script, but is not working for me :frowning:

{

"settings": {"number_of_shards": 3, "number_of_replica": 0},

"mappings": {

"employee": {

  "_source": {"enabled": true},

"_boost": {"name": "surname","null_value": 2},

  "properties": {"name": {"type": "string"},"surname": {"type":

"string"},"phone": {"type": "string"}

} } } }


(system) #3