# HSEARCH400609: Unknown field 'attributes.someattributename'

**URL:** <https://discourse.hibernate.org/t/hsearch400609-unknown-field-attributes-someattributename/6114>\
**Category:** Hibernate Search\
**Created:** [March 3, 2022, 10:50am UTC](https://discourse.hibernate.org/t/hsearch400609-unknown-field-attributes-someattributename/6114 "2022-03-03T10:50:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![yrodiere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yrodiere/32/1760_2.png) [@yrodiere](https://discourse.hibernate.org/u/yrodiere)\
**Post date:** [March 3, 2022, 11:24am UTC](https://discourse.hibernate.org/t/hsearch400609-unknown-field-attributes-someattributename/6114/4 "2022-03-03T11:24:54Z")

</div>

You are missing a template for your value fields (non-object fields). As a result, when you add a value in your bridge here, Hibernate Search does not have any metadata about the field you’re attempting to add a value for, and cannot determine how to turn the value into JSON:

> [@Prashant\_Kamble](#):
>
> ```java
> indexedAttributeMetadata.addValue(fieldName,attributeValue.toString());
> 
> ```

Define another template for your value fields. Something like this:

```java
public class ResourceAttributesBinder implements PropertyBinder {
    @Override
    public void bind(PropertyBindingContext context) {
        context.dependencies().useRootOnly();
        PojoModelProperty bridgedElement = context.bridgedElement();
        IndexSchemaObjectField attributeField = context.indexSchemaElement()
                .objectField( bridgedElement.name() );

        // ADD THIS
        attributeField.fieldTemplate( 
                "attributeFieldValueTemplate_default",
                f -> f.asString().analyzer( "english" )
        );

        context.bridge(Map.class,new ResourceAttributesPropertyBridge(attributeField.toReference()));
    }
}

```

Note this is almost exactly the code of the second example in [this link](https://stackoverflow.com/a/66493009/6692043) that I gave you in answer to [your other question](https://stackoverflow.com/questions/71235164/unable-to-find-below-classes-in-hibernate-search-6).

---

_[View the full topic](https://discourse.hibernate.org/t/hsearch400609-unknown-field-attributes-someattributename/6114)._
