2012-10-19 7 views
0

내 사이트의 콘텐츠에 가변 길이의 문자열 태그가 지정되어 있으며 이러한 태그에면 검색을 수행하려고합니다. 예를 들어 이야기에는 "내전", "일반 교부금"및 "게티스버그 전투"라는 태그가있을 수 있습니다. 정확히 토큰 화되지 않은 문자열에 대해 파셋 검색을 수행 할 수 있기를 원합니다. 내 search_index.py 내Django Haystack faceting 다중 값 문자열 - 알 수없는 필드 tags_exact

, 나는 정의 :

tags = MultiValueField(faceted=True, indexed=True) 

내가 태그 대신 텍스트 문자열 만들기 build_solr_schema에 의해 생성 된의 schema.xml 편집 : 내가 얻을 불행하게도

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

을 tags에 대한 오류 : 정확함 :

Failed to add documents to Solr: [Reason: None] 
ERROR: [doc=treelines_stories.story.1] unknown field 'tags_exact' 

나는 tags_exact 필드 Haystack의 내부 패 시팅 구현과 관련이 있지만 어떻게해야합니까?

감사합니다.

답변

2

search_index.py :

tags = MultiValueField(faceted=True) 

의 schema.xml :

<field name="tags" type="text" indexed="true" stored="true" multiValued="true" /> 
<field name="tags_exact" type="string" indexed="true" stored="true" multiValued="true" />