# Searching Jet Engine Custom Meta Storage fields

Jet engine 3.4 added a feature to store custom fields in separate tables for post types created by Jet Engine. This is a great feature, and integrates well with WordPress.

<figure><img src="https://1744076133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M9rmHbZfTKVQ7YzbIZL%2Fuploads%2FdvvWXbutwU7Opz26CxHD%2Fimage.png?alt=media&#x26;token=87fd89c9-19dc-479d-a352-5238a37f4d06" alt="" width="375"><figcaption><p>Jet engine custom meta storage feature</p></figcaption></figure>

Because these fields are stored outside of the metadata table, a small custom code snippet is required to fetch the contents and append to the index table:

* Make sure to safely use this code, please read [this guide](https://knowledgebase.ajaxsearchpro.com/safe-coding-guideline) for how and where to put it
* Add the custom field names to the **$jet\_custom\_fields** variable (on line 5), line-by-line, use the existing values as a template
* [Configure](https://documentation.ajaxsearchpro.com/index-table) and [enable](https://documentation.ajaxsearchpro.com/index-table/enabling-index-table-engine) the index table engine so the field values are indexed. You will notice that you can't find these fields to index, but do not worry, the custom code will cover that.
* Enjoy :smile:

```php
add_action(
	'asp_it_args',
	function ($args) {
		// Add the fields to this array
		$jet_custom_fields = array(
			'jet_meta_field1',
			'jet_meta_field2',
		);

		// --------------------------------------------
		// --- DO NOT CHANGE ANYTHING BELOW
		if( is_array($args['index_customfields']) ) {
			$args['index_customfields'] = array_merge(
				$args['index_customfields'],
				$jet_custom_fields
			);
		} else {
			$jet_custom_fields = implode('|', $jet_custom_fields);
			$args['index_customfields'] =
				$args['index_customfields'] == '' ?
					$jet_custom_fields :
					$args['index_customfields'] . '|' . $jet_custom_fields;
		}
		return $args;
	},
	10,
	1
);
```
