Solr: change default value of MaxFieldLength in

2019-08-04 05:31发布

问题:

Is there a way to change the default <mainIndex><maxFieldLength> value in the solarconfig.xml file, so that when a Solr collection is created ALL collections will use the new value?

The default value of 10000 is okay for most applications, but most of the PDFs I am working with are over 100 pages. The client is concerned that the search results do not return EVERY PDF containing the given keywords. Correct me if I'm wrong, but I'm pretty sure that the maxFieldLength is limiting the indexing to just a fraction of the PDFs.

回答1:

Please note that <maxFieldLength> is restricting the number of tokens, not characters that are indexed. See - http://lucene.472066.n3.nabble.com/maxFieldLength-td490843.html for a discussion around this.

Update: I was incorrect previously, in order to change this value for all collections, you will need to add a property to your solr.xml file as shown in Solr.xml. That property can then be referenced in your solrconfig.xml file <maxFieldLength> setting in each core/collection.

However, I am not sure how this would be incorporated into the ColdFusion implementation as I am not familiar with how CF works. It may need to remain a manual process.