Search code examples
solrindexingsolrnetsynonym

SolrNet: Can size of the synonym.txt file be an issue while indexing?


My indexing was working fine initially. I then changed my schema to use SynonymFilterFactory while indexing. My synonym.txt file is 1.27MB. Since then whenever I have tried to reindex using synonym, I get this random "The request was aborted: The request was canceled." error.

It is strange that some of the items were indexed and some were not. I just can't figure out what the issue is. The only difference is the usage of Synonymfilter. the format of synonym.txt is fine. Since almost of the items do get index before the error is thrown, I can't say that there is something wrong with the schema.

So can the size of synonym.txt result in an error at index time? Any tips, suggestions will be highly appreciated.


Solution

  • The error means that SolrNet is timing out when sending documents to Solr. The fact that your synonym file is large is relevant if you're expanding synonyms at index-time (you can do it at query-time instead, or even both), since it will take longer for Solr to analyze the input data.

    Still, I doubt that it will time out for a single document. If it does, the only thing you can do is increasing the timeout. If you're sending multiple documents at once (most likely), you'll have to use decrease the amount of documents sent at once, i.e. send more but smaller batches of documents.