title: Building search index for Json in cloudant
body: <p>I have built search index for sample db and run a search query in cloudant scussessfully. For example, I had a database as:</p>
  
  <pre><code>{
    "_id": "aardvark",
    "_rev": "3-fe45a3e06244adbe7ba145e74e57aba5",
    "min_weight": 40,
    "max_weight": 65,
    "min_length": 1,
    "max_length": 2.2,
    "latin_name": "Orycteropus afer",
    "wiki_page": "http://en.wikipedia.org/wiki/Aardvark",
    "class": "mammal",
    "diet": "omnivore"
  }
  </code></pre>
  
  <p>For indexing "_id" or "class" i can create search index as:</p>
  
  <pre><code>function(doc){
    index("default", doc._id);
  ...
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>function(doc){
    index("default", doc.class);
  ... 
  }
  </code></pre>
  
  <p>However, I don't know how to index on Json format. For example, i have a Json format as:</p>
  
  <pre><code>  "_id": "08ff683d86484139",
    "_rev": "4-cf6f34c6a2a22780a646b86a3f8d1848",
    "lastUpdated": "2014-01-31 00:00:00",
    "issueId": 62655,
    "isThirdParty": true,
    "dateCreated": "2014-01-29 00:00:00",
    "attributeCollection": {
      "attributeArray": [
        {
          "updateable": false,
          "lookup": "issuetype",
          "issueAttributeDefinitionId": 13,
          "attributeType": 1,
          "name": "Web Type",
          "value": [
            "Improper Neutralization of Input During Web Page Generation"
          ]
        },
   "appReleaseId": 57,
    "hash": "953b33eca52938ab2d21e27eb171998b"
  }
  </code></pre>
  
  <p>My question is how to index properties in "attributeCollection" of Json format. Particularly, how to index for</p>
  
  <pre><code>"name": "Web Type",
  </code></pre>
  
  <p>and</p>
  
  <pre><code>"value": ["Improper Neutralization of Input During Web Page Generation"] 
  </code></pre>