Configure merge_block_size in sphinx search engine

I use web search using Sphinx, and when creating indexes I get the following error message:

WARNING: sort_hits: merge_block_size = 76 kb is too low, increasing mem_limit can improve performance

The problem is that I cannot find the documentation on setting this parameter. I am a little versed in setting up Sphinx, so I just need to know where the setting is configured.

+4
source share
2 answers

This is probably because you are trying to index too many elements at once. Make sure you are using ordinary queries . If you are already using mem_limit queries, mem_limit help may help, as it prompts. merge_block_size based on mem_limit and the number of documents.

If you are interested in how it generates this number, check the source. It is freely available.

+4
source

In sphinx.conf:

 sql_query_range = SELECT MIN(id),MAX(id) FROM documents sql_range_step = 1000 sql_query = SELECT * FROM documents WHERE id>=$start AND id<=$end 

If the table contains document identifiers from 1 to, say, 2345, then sql_query will run three times:

  • with the replacement of $ start by 1 and $ end replaced by 1000;
  • with the replacement of $ start by 1001 and $ end replaced by 2000;
  • with the replacement of $ start by 2000 and $ end replaced by 2345.

Obviously, this is not a big difference in a 2000 row table, but when it comes to indexing a MyISAM table of 10 million rows, assignments in the range can be of some help.

http://sphinxsearch.com/docs/current.html#ranged-queries

Hope this works for you.

+2
source

All Articles