solr schema.xml配置文件的理解

schema.xml中的 语句的理解

<field name="propertyvalues" type="string" indexed="true" stored="true" multiValued="true"/>

1.只有index=true 的字段才能做facet.field的字段,同时只有index=true该字段才能当做搜索的内容 当然store=true或者false没关系

  • 将不需要被用于搜索的,而只是作为结果返回的field的indexed设置为false

2.store=true的好处是,从页面获取的json数据,如果该字段设置store=true则可以通过json获取该字段 同时才会在solr界面上显示

3.multiValued="true"的理解

先看如下图片 假如我进行语句:select value ‘propertyvalues’ from 下表 where productId=1

得出的结果有 52以下 、 冰糯种 、 白色 、 手镯

solr schema.xml配置文件的理解

这样value 有多个值, 我们需要将字段propertyvalues 设置成multiValued="true" 如下图显示

solr schema.xml配置文件的理解


如果没有设置multiValued="true" 则只会显示第一个值,即显示一个