# Should not analyze the data while indexing and searching

**URL:** <https://discuss.elastic.co/t/should-not-analyze-the-data-while-indexing-and-searching/36289>\
**Category:** Elasticsearch\
**Created:** [December 3, 2015, 1:20pm UTC](https://discuss.elastic.co/t/should-not-analyze-the-data-while-indexing-and-searching/36289 "2015-12-03T13:20:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanju1323](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@sanju1323](https://discuss.elastic.co/u/sanju1323)\
**Post date:** [December 3, 2015, 1:20pm UTC](https://discuss.elastic.co/t/should-not-analyze-the-data-while-indexing-and-searching/36289/1 "2015-12-03T13:20:49Z")

</div>

Hi,  
I have an issue regarding Elasticsearch Indexing and searching.  
I'm trying to index data to elasticsearch using java. After indexing I have observed that it is taking "Kenneth Cole" as "Kenneth" and "Cole".

This is happening while searching the data from elasticsearch also. If I search for "Kenneth Cole", it is searching for "Kenneth" OR "Cole". I'm using the following code.

```auto
public class elastic {

	public static void main(String[] args) throws IOException {
		Client client = new TransportClient().addTransportAddress(new InetSocketTransportAddress("localhost", 9300));

		BulkRequestBuilder bulkRequest = client.prepareBulk();
		bulkRequest.add(client.prepareIndex("twitter", "tweet", "1")
		        .setSource(jsonBuilder()
		                    .startObject()
		                        .field("user", "kimchy")
		                        .field("postDate", new Date())
		                        .field("message", "trying out Elasticsearch")
		                    .endObject()
		                  )
		        );
		bulkRequest.add(client.prepareIndex("twitter", "tweet", "3")
		        .setSource(jsonBuilder()
		                    .startObject()
		                        .field("user", "kimchy")
		                        .field("postDate", new Date())
		                        .field("message", "another post")
		                    .endObject()
		                  ) );	
		BulkResponse bulkResponse = bulkRequest.get();
        }

```

Please help me in getting out of this issue.

Thanks & Regards,  
Sanjay Reddy.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 3, 2015, 1:59pm UTC](https://discuss.elastic.co/t/should-not-analyze-the-data-while-indexing-and-searching/36289/2 "2015-12-03T13:59:37Z")

</div>

This is expected. This is how analysis process works.

You should read this chapter: [https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-analysis.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-analysis.html)

---

<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 5, 2017, 11:33pm UTC](https://discuss.elastic.co/t/should-not-analyze-the-data-while-indexing-and-searching/36289/3 "2017-07-05T23:33:51Z")

</div>


