use of com.rbmhtechnology.vind.model.FieldDescriptor in project vind by RBMHTechnology.
the class SolrFilterSerializer method getFieldName.
private String getFieldName(String name, String searchContext, SolrUtils.Fieldname.UseCase usecase) {
FieldDescriptor descriptor = factory.getField(name);
if (Objects.isNull(descriptor)) {
log.error("Unable to serialize solr filter: there is no field descriptor with name '{}'", name);
throw new IllegalArgumentException("Unable to serialize solr filter: there is no field descriptor with name '" + name + "'");
}
if (Objects.isNull(usecase)) {
usecase = SolrUtils.Fieldname.UseCase.Facet;
}
final String fieldName = SolrUtils.Fieldname.getFieldname(descriptor, usecase, searchContext);
if (Objects.isNull(fieldName)) {
log.error("Unable to serialize solr filter: there is no valid solr field for descriptor with name '{}' and use case {}", name, usecase);
throw new RuntimeException("Unable to serialize solr filter: there is no valid solr field for descriptor with name '" + name + "' and use case " + usecase);
}
return fieldName;
}
use of com.rbmhtechnology.vind.model.FieldDescriptor in project vind by RBMHTechnology.
the class SolrChildrenSerializerVisitor method isHierarchical.
private boolean isHierarchical(String fieldName) {
if (Objects.nonNull(this.childFactory)) {
FieldDescriptor parentDescriptor = this.parentFactory.getField(fieldName);
FieldDescriptor childDescriptor = this.childFactory.getField(fieldName);
if (Objects.nonNull(parentDescriptor) && Objects.isNull(childDescriptor)) {
return true;
}
return false;
}
return true;
}
use of com.rbmhtechnology.vind.model.FieldDescriptor in project vind by RBMHTechnology.
the class SolrChildrenSerializerVisitor method getFieldName.
private String getFieldName(String name, String searchContext, SolrUtils.Fieldname.UseCase usecase, DocumentFactory factory) {
FieldDescriptor descriptor = factory.getField(name);
if (Objects.isNull(descriptor)) {
log.error("Unable to serialize solr filter: there is no field descriptor with name '{}'", name);
throw new RuntimeException("Unable to serialize solr filter: there is no field descriptor with name '" + name + "'");
}
if (Objects.isNull(usecase)) {
usecase = SolrUtils.Fieldname.UseCase.Facet;
}
final String fieldName = SolrUtils.Fieldname.getFieldname(descriptor, usecase, searchContext);
if (Objects.isNull(fieldName)) {
log.error("Unable to serialize solr filter: there is no valid solr field for descriptor with name '{}' and use case {}", name, usecase);
throw new RuntimeException("Unable to serialize solr filter: there is no valid solr field for descriptor with name '" + name + "' and use case " + usecase);
}
return fieldName;
}
use of com.rbmhtechnology.vind.model.FieldDescriptor in project vind by RBMHTechnology.
the class SolrFilterSerializerVisitor method getFieldName.
private String getFieldName(String name, String searchContext, SolrUtils.Fieldname.UseCase usecase, DocumentFactory factory) {
FieldDescriptor descriptor = factory.getField(name);
if (Objects.isNull(descriptor)) {
log.error("Unable to serialize solr filter: there is no field descriptor with name '{}'", name);
throw new IllegalArgumentException("Unable to serialize solr filter: there is no field descriptor with name '" + name + "'");
}
if (Objects.isNull(usecase)) {
usecase = SolrUtils.Fieldname.UseCase.Facet;
}
final String fieldName = SolrUtils.Fieldname.getFieldname(descriptor, usecase, searchContext);
if (Objects.isNull(fieldName)) {
log.error("Unable to serialize solr filter: there is no valid solr field for descriptor with name '{}' and use case {}", name, usecase);
throw new RuntimeException("Unable to serialize solr filter: there is no valid solr field for descriptor with name '" + name + "' and use case " + usecase);
}
return fieldName;
}
use of com.rbmhtechnology.vind.model.FieldDescriptor in project vind by RBMHTechnology.
the class SolrFilterSerializerVisitor method isHierarchical.
private boolean isHierarchical(String fieldName) {
if (Objects.nonNull(this.childFactory)) {
FieldDescriptor parentDescriptor = this.parentFactory.getField(fieldName);
FieldDescriptor childDescriptor = this.childFactory.getField(fieldName);
if (Objects.nonNull(childDescriptor) && Objects.isNull(parentDescriptor)) {
return true;
}
return false;
}
return false;
}
Aggregations