Java - finding exact values


i want mark a mapping with "not_analyzed" in java like described here:

After the code below, i index two products, refresh the index and run a
termQuery("productUrl", "man-prod2")

But i still get both documents, so i think in my code below is something wrong to set the mapping as "not_analyzed"

Any suggestions?

Kind regards

		final Client client = TransportClient.builder().build()
		        .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300));
		client.admin().indices().create(new CreateIndexRequest("myindex")).actionGet();

		final XContentBuilder xcb = XContentFactory.jsonBuilder().prettyPrint()
	                    .startObject("productUrl").field("type", "string").field("index", "not_analyzed").endObject()
		final IndexResponse response = client.prepareIndex("myindex", "products")

got it working: