I have added below attributes in index through this code
"archetype" : {
"archetypeId" : "spring-boot",
"source" : "repository_generation"
},
"serviceConfig" : {
"isExisting" : "false"
},
"opsgenie" : {
"uuid" : "123"
}
It is working fine if I tried to search like serviceConfig.isExisting:false
or archetype.archetypeId:spring-boot
or opsgenie.uuid:123
but if tried to search with invalid attribute (unavailable attribute) like serviceConfig.something:123
we are getting below error message for all the invalid attributes
"errorCode": "Internal",
"errors": [
{
"message": "HSEARCH400611: Invalid type: 'archetype.archetypeId' is a value field, not an object field.",
"field": null,
"value": null
}
]
}
Actually error message should include that invalid attribute and not archetype.archetypeId'
every time.
Note: I am searching different attribute not archetype one and in hibernate search 5 it was coming empty response for invalid attributes which was expected.
Here is the exception which we are getting while searching:
SearchException: HSEARCH400611: Invalid type: 'archetype.archetypeId' is a value field, not an object field.
at org.hibernate.search.backend.elasticsearch.document.model.impl.ElasticsearchIndexSchemaValueFieldNode.toObjectField(ElasticsearchIndexSchemaValueFieldNode.java:48)
at org.hibernate.search.backend.elasticsearch.document.model.impl.AbstractElasticsearchIndexSchemaFieldTemplate.lambda$createNodeIfMatching$0(AbstractElasticsearchIndexSchemaFieldTemplate.java:43)
at java.util.Optional.map(Optional.java:215)
at org.hibernate.search.backend.elasticsearch.document.model.impl.AbstractElasticsearchIndexSchemaFieldTemplate.createNodeIfMatching(AbstractElasticsearchIndexSchemaFieldTemplate.java:42)
at org.hibernate.search.backend.elasticsearch.document.model.impl.ElasticsearchIndexModel.fieldOrNullIgnoringInclusion(ElasticsearchIndexModel.java:142)
at org.hibernate.search.backend.elasticsearch.document.model.impl.ElasticsearchIndexModel.fieldOrNull(ElasticsearchIndexModel.java:104)
at org.hibernate.search.backend.elasticsearch.document.model.impl.ElasticsearchIndexModel.fieldOrNull(ElasticsearchIndexModel.java:100)
at org.hibernate.search.backend.elasticsearch.scope.model.impl.ElasticsearchScopeSearchIndexesContext.field(ElasticsearchScopeSearchIndexesContext.java:93)
at org.hibernate.search.backend.elasticsearch.search.predicate.impl.ElasticsearchSimpleQueryStringPredicate$Builder.field(ElasticsearchSimpleQueryStringPredicate.java:181)
at org.hibernate.search.engine.search.predicate.dsl.impl.SimpleQueryStringPredicateFieldMoreStepImpl$CommonState.field(SimpleQueryStringPredicateFieldMoreStepImpl.java:74)
at org.hibernate.search.engine.search.predicate.dsl.impl.SimpleQueryStringPredicateFieldMoreStepImpl.<init>(SimpleQueryStringPredicateFieldMoreStepImpl.java:38)
at org.hibernate.search.engine.search.predicate.
Any idea/thoughts?