# Boundary\_chars not working

**URL:** <https://discuss.elastic.co/t/boundary-chars-not-working/14814>\
**Category:** Elasticsearch\
**Created:** [December 11, 2013, 11:31am UTC](https://discuss.elastic.co/t/boundary-chars-not-working/14814 "2013-12-11T11:31:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dagda1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dagda1/32/1909_2.png) [@dagda1](https://discuss.elastic.co/u/dagda1)\
**Post date:** [December 11, 2013, 11:31am UTC](https://discuss.elastic.co/t/boundary-chars-not-working/14814/1 "2013-12-11T11:31:09Z")

</div>

I am trying to limit what is highlighted by setting boundary\_chars and  
boundary\_max\_scan:

I have created my index with the following statement:

curl -XPUT 'localhost:9200/\_river/email/\_meta' -d '{  
"type" : "jdbc",  
"jdbc" : {  
"strategy":"simple",  
"poll":"10",  
"driver" : "org.postgresql.Driver",  
"url" : "jdbc:postgresql://localhost:5432/api\_development",  
"username" : "paulcowan",  
"password" : "",  
"sql" : "SELECT distinct e.id as "\_id", ep.user\_id as "user\_id",  
folder, subject, body, personal, sent\_at, read\_by, account\_id,  
sender\_user\_id, sender\_contact\_id, html, draft FROM emails e inner join  
email\_participants ep on e.id = ep.email\_id where ep.user\_id is not null"  
},  
"index" : {  
"index" : "email",  
"type" : "jdbc",  
"type\_mapping": "{"email" : {"properties" :  
{"folder":{"type":"string","index":"not\_analyzed"},"subject":{"type":"string","term\_vector":"with\_positions\_offsets"},"html":{"type":"string","term\_vector":"with\_positions\_offsets"},"body":{"type":"string","term\_vector":"with\_positions\_offsets"}}}}"  
}  
}'

If I list my mappings they are:

{

"jdbc" : {

```
"properties" : { 

  "account_id" : { 

    "type" : "long" 

  }, 

  "body" : { 

    "type" : "string", 

    "term_vector" : "with_positions_offsets" 

  }, 

  "draft" : { 

    "type" : "boolean" 

  }, 

  "folder" : { 

    "type" : "string", 

    "index" : "not_analyzed", 

    "omit_norms" : true, 

    "index_options" : "docs" 

  }, 

  "html" : { 

    "type" : "string", 

    "term_vector" : "with_positions_offsets" 

  }, 

  "personal" : { 

    "type" : "boolean" 

  }, 

  "read_by" : { 

    "type" : "string" 

  }, 

  "sender_contact_id" : { 

    "type" : "long" 

  }, 

  "sender_user_id" : { 

    "type" : "long" 

  }, 

  "sent_at" : { 

    "type" : "date", 

    "format" : "dateOptionalTime" 

  }, 

  "subject" : { 

    "type" : "string", 

    "term_vector" : "with_positions_offsets" 

  }, 

  "user_id" : { 

    "type" : "long" 

  } 

} 

```

}

}

If I issue the following search:

curl -XGET '[http://localhost:9200/email/jdbc/\_search?pretty=true](http://localhost:9200/email/jdbc/_search?pretty=true)' -d '{

```
"query": {

    "query_string": {

      "query": "fullcontact*",

      "default_operator": "AND"

    }

},

"highlight" : {

"pre_tags": ["<em class='highlight'>"],

"post_tags": ["</em>"],

    "fields" : {

        "subject" : {

          "boundary_chars": ".,!? \t\n",

          "boundary_max_scan": 0

        },

        "body": {

          "boundary_chars": ".,!? \t\n",

          "boundary_max_scan": 0

        },

        "html": {

          "boundary_chars": ".,!? \t\n",

          "boundary_max_scan": 0

        }

    }

},

"filter": {

    "bool": {

        "must": [

          {"term": {"account_id": 1}},

          {"term": {"folder": "INBOX"}},

          {"term": { "user_id": 3}}

        ]

    }

}

```

}'

Then I get back results like this:

"highlight" : {

```
    "body" : [ "The <em class=highlight>FullContact</em> Playbook\nLife 

```

is a contact sport. Play it well.\n\nOctober 4, 2013\n\n==================", "ic/?utm\_source=_fullcontact_-weekly-playbook&utm\_medium=email&utm\_campaign=_fullcontact_-weekly-playbook)", "me/?utm\_source=_fullcontact_-weekly-playbook&utm\_medium=email&utm\_campaign=_fullcontact_-weekly-playbook)", "ng/?utm\_source=_fullcontact_-weekly-playbook&utm\_medium=email&utm\_campaign=_fullcontact_-weekly-playbook)", "ct/?utm\_source=_fullcontact_-weekly-playbook&utm\_medium=email&utm\_campaign=_fullcontact_-weekly-playbook)" ],

```
    "subject" : [ "<em class=highlight>FullContact</em> - Weekly 

```

Playbook" ],

```
    "html" : [ "name=\"viewport\" 

```

content="width=device-width"\>\n\t_FullContact_ - Weekly  
Playbook\n\n\t\n\t\n\t\<!--FIXES FOR", "160);font-size:  
13px;text-align: center;"\>The _FullContact_  
Playbook – Life is a contact sport. Play", "#009ebb;  
text-decoration:none;" href="http://_fullcontact.us2_.list-manage1.com/track/click?u=92c1a2b7e3b"  
, "width="698" alt="The _FullContact_ Playbook"  
src="[https://s3.amazonaws.com/](https://s3.amazonaws.com/)_fullcontact_-static/images/emai", "Play it well."  
src="[https://s3.amazonaws.com/](https://s3.amazonaws.com/)_fullcontact_-static/images/emails/newsletter/tagline.jpg""  
]

```
  }

} ]

```

}

}

The boundary\_chars is not working as it is highlighting the term  
fullcontact after an equals sign or really anything.

e.g. ?utm\_source=_fullcontact_

I cannot find an online example of how to set these values correctly. Can  
anybody help?

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/34a8f38d-36a7-456f-a291-7b1adf012723%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/34a8f38d-36a7-456f-a291-7b1adf012723%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:02am UTC](https://discuss.elastic.co/t/boundary-chars-not-working/14814/2 "2017-07-06T02:02:00Z")

</div>


