Adding new fields to search

we are adding some fileds to the documents  by using 

static void Events_BeforeBulkIndex(BeforeBulkIndexingEventArgs e){
foreach (var doc in e.Documents)
			{
			
			if (doc.ContentTypeId == apiBlogPost.ContentTypeId)
				{
				BlogPost blogPost = apiBlogPost.Get(doc.ContentId);
					if (blogPost == null) return;
					var labelvalue = blogPost.ExtendedAttributes["somefiled"]?.Value;
					if (!string.IsNullOrEmpty(labelvalue))
					{
						doc.AddField("key", labelvalue);
							}
					
				}
			
			}
			
}

But if we search for the value , we are unable to find them in search results

Parents Reply
  • we are using contentmetadata plugin and enabled search

    we are adding a key-value pair as 'ideadid'-'10005' for ideas

    #set($searchResultsResponse = $core_v2_searchResult.List("%{  FieldFacets = 'metadata_ideaid' , Query ='metadata_ideaid=100005' }"))
    
    $searchResultsResponse

    But i am unable to retrieve anything? Please let me know what's wrong i was doing in the code

Children