Solrj pojo Java 类型如何映射到 Solr 类型? [英] How do Solrj pojo Java types map to Solr types?

查看:23
本文介绍了Solrj pojo Java 类型如何映射到 Solr 类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Solr 的新手,我正在尝试使用 Solrj pojo 创建我的文档.

I'm new to Solr, and I'm trying to use Solrj pojo's to create my documents.

我应该在我的 pojo 中遵守 Solr 类型到 Java 的映射吗?pojo 中的所有内容都是字符串吗?是否有从 Java 基本类型到 Solr 的神奇映射并且它是透明的?

Is there a mapping of Solr types to Java I should adhere to in my pojo's? is everything in the pojo a String? is there a magical mapping from Java basic types to Solr and it's transparent?

这似乎是一个基本问题,但我找不到答案.

This seems like a basic question but I can't find an answer.

TIA.

推荐答案

这个问题的答案似乎是,对于 Solrj bean(使用 @Field),字段的 Java 类型是 Java OBJECT 对应于 solr.*Field 类型.

The answer to this question appears to be that for Solrj beans (using @Field) the Java type of the field is a Java OBJECT that corresponds to the solr.*Field type.

例如 solr.BoolField 映射到 java.lang.Boolean.

For instance solr.BoolField maps to java.lang.Boolean.

长、整数、浮点数、... 也一样

Same follows for Long, Integer, Float, ...

我希望这能帮助下一个可怜的灵魂:-)

I hope this helps the next poor soul :-)

这篇关于Solrj pojo Java 类型如何映射到 Solr 类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆