사용할 수있는 필드 유형간에 약간의 혼란이 있습니다. string
대 strings
및 int
대 ints
및 기타 데이터 유형에 대한 선호도.필드 유형 문자열 대 문자열
다음 4 가지 차이점은 무엇입니까?
<field name="string_multi" type="string" multiValued="true" indexed="true" stored="true"/>
<field name="string_single" type="string" indexed="true" stored="true"/>
<field name="strings_multi" type="strings" multiValued="true" indexed="true" stored="true"/>
<field name="strings_single" type="strings" indexed="true" stored="true"/>
문서가있는 경우, hashtags
이라는 필드에 대해 무엇을 선언해야합니까?
String multivalued
또는 strings multivalue
또는 strings without multivalue
,?
<fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" />
<fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true" docValues="true" />
이을 편집
: 실제로 fieldType 정의를 보면 잘{
"polarity":0.0,
"text":"RT @socialistudents: Vlad - we go to NUS conference not just as individuals but as members of Socialist Students #SocStu17",
"created_at":"Sun Feb 12 19:28:34 +0000 2017",
"hashtags":[
"hashtag1",
"hashtag2"
],
"subjectivity":0.0,
"retweet_recount":4,
"id":830861171582439424,
"favorite_count":0
}
'필드 이름'을 정의 할 때 혼동이있었습니다. 따라서 'multiValued' 속성을'field name = "your_field_name"type = "strings"로 선언 할 수 있습니다 multiValued = "true"sortMissingLast = "true"docValues = "true"indexed = "false"required = "true"stored = "true"/>'. 음, 그들은 똑같은 것으로 드러납니다. 조금 혼란스럽고'필드 이름'중에'multiValued'가 중복됩니다. 'multiValued'는'field type'에 의해 결정됩니다. –
예, 미안합니다. 두 번째 것에 's'를 놓쳤습니다. 고정 – Jayce444
그래, 필드에 '다중 값'을 선언 할 수도 있습니다. 그래서 해시 태그 데이터 구조가 주어진다면 필드 정의에'multiValued = "true"'를 넣을 수 있습니다 – Jayce444