Search:

Search all manuals
Search this manual
Manual
Couchbase Plug-in for Elasticsearch
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
4 Monitoring and Troubleshooting
Chapter Sections
Chapters

4.4. Advanced Settings and Features

The Couchbase Plug-in for Elasticsearch has several settings in a YAML file that you can update. In the beginning you will probably only update the username and password for the plug-in. Later you may want to change these additional settings:

Understanding Metadata

As you get more advanced in your usage of Couchbase Plug-in for Elasticsearch, it might be helpful for you to understand what is actually sent via the plug-in and how Elasticsearch uses it. When you send a JSON document to Couchbase Server to store, it looks similar to the following:

{
   "name": "Green Monsta Ale",
   "abv": 7.3,
   "ibu": 0,
   "srm": 0,
   "upc": 0,
   "type": "beer",
   "brewery_id": "wachusetts_brewing_company",
   "updated": "2010-07-22 20:00:20",
   "description": "A BIG PALE ALE with an awsome balance of Belgian malts with Fuggles and East Kent Golding hops.",
   "style": "American-Style Strong Pale Ale",
   "category": "North American Ale"
}

Here we have a JSON document with all the information for a beer in our application. When Couchbase stores this document, it adds metadata about the document so that we now have JSON in Couchbase that looks like this:

{
	{
   "id": "wachusetts_brewing_company-green_monsta_ale",
   "rev": "1-00000005ce01e6210000000000000000",
   "expiration": 0,
   "flags": 0,
   "type": "json"
	}
	{
   	"name": "Green Monsta Ale",
   	"abv": 7.3,
   	"ibu": 0,
   	"srm": 0,
   	"upc": 0,
   	"type": "beer",
   	"brewery_id": "wachusetts_brewing_company",
   	"updated": "2010-07-22 20:00:20",
   	"description": "A BIG PALE ALE with an awsome balance of Belgian malts with Fuggles and East Kent Golding hops.",
   	"style": "American-Style Strong Pale Ale",
   	"category": "North American Ale"
	}
}

The metadata that Couchbase Server stores with our beer document contains the key for the document, an internal revision number, expiration, flags and the type of document. When Couchbase Server replicates data to Elasticsearch via the plug-in, it sends this entire JSON including the metadata. Elasticsearch will then index the document and will store the following JSON with document metadata:

{
  "id": "wachusetts_brewing_company-green_monsta_ale",
  "rev": "1-00000005ce01e6210000000000000000",
  "expiration": 0,
  "flags": 0,
  "type": "json"
}

And finally when you query Elasticsearch and get a result set, it will contain the document metadata only:

{
	took: 22
	timed_out: false
	_shards: {
	total: 5
	successful: 5
	failed: 0
},
	hits: {
	total: 1
	max_score: 0.18642133
	hits: [
		{
		_index: beer-sample
		_type: couchbaseDocument
		_id: wachusetts_brewing_company-green_monsta_ale
		_score: 0.18642133
			_source: {
				meta: {
					id: wachusetts_brewing_company-green_monsta_ale
					rev: 1-00000005ce01e6210000000000000000
					flags: 0
					expiration: 0
					}
				}
			}
		]
	}
}