Adding a document to the index in SOLR: Document contains at least one immense term

前端 未结 2 495
无人共我
无人共我 2021-01-11 12:06

I am adding (by a Java program) for indexing, a document in SOLR index, but after add(inputDoc) method there is an exception. The log in solr web interface cont

2条回答
  •  自闭症患者
    2021-01-11 12:33

    You probably met what is described in LUCENE-5472 [1]. There, Lucene throws an error if a term is too long. You could:

    • use (in index analyzer), a LengthFilterFactory [2] in order to filter out those tokens that don't fall withing a requested length range

    • use (in index analyzer), a TruncateTokenFilterFactory [3] for fixing the max length of indexed tokens

    • use a custom UpdateRequestProcessor, but this actually depends on your context

    [1] https://issues.apache.org/jira/browse/LUCENE-5472
    [2] https://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.LengthFilterFactory
    [3] https://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.TruncateTokenFilterFactory [4] https://wiki.apache.org/solr/UpdateRequestProcessor

提交回复
热议问题