# 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="/files/rMrfnzfb9wNmra7F5i8i" 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](/safe-coding-guideline.md) 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
);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://knowledgebase.ajaxsearchpro.com/miscellaneous/jet-engine/searching-jet-engine-custom-meta-storage-fields.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
