The Core Search Indexer should be turned off automatically if you set Apache Solr Search the default.

Currently the user has to set 'Number of items to index per cron run' to "0" manually at the Core Search configuration page in order to gain a massive performance boost at drupal cron runs.

I attached a patch that turns the Core Search Indexer on and off automatically depending on your solr settings. The patch could be applied to 6.x-2.x-dev and 6.x-1.x-dev.

Comments

pwolanin’s picture

Well, we don't do that since some people want core search as a fallback.

mkalkbrenner’s picture

StatusFileSize
new2.49 KB
new2.51 KB

@pwolanin:
You're right.

I adjusted the patch to deal with the combination of 'Make Apache Solr Search the default' and 'On failure' => 'Show core Drupal results'.

From my point of view this patch will improve the usability. I already saw different installations where Solr was the default without the core search fallback in case of an error. But the core search indexer has not been turned off. On big sites this massively slows down the cron and the database backup due to the size of core search tables.

cfennell’s picture

Legitimate issue, but this seems a little more like a documentation issue to me. What about simply adding a note to the install directions?

mkalkbrenner’s picture

@unexpand:
Yes, improving the documentation is an option.

On the other hand Robert asked me to reduce to the configuration and to automate more things in Apache Solr Multilingual.

From my point of view features like this can improve the user experience. Especially if someone doesn't read the documentation ;-)

jpmckinney’s picture

Issue tags: +D6

Note: Not an issue in 7.x

jpmckinney’s picture

cfennell’s picture

mvc’s picture

This is both a documentation and usability issue. I think that at minimum if the user has chosen to override core searches and search_cron_limit is not 0, then this module should display a message on the solr settings page reminding people that search.module is indexing their site (with a link to the search module settings page where they can change this).

Personally, I've been using solr for about a year, I've read the install instructions, I've given presentations about sites built with solr and drupal, and I've implemented hook_apachesolr_update_index() a few times now, but I just realized this week that search.module was still indexing my site as I worked on a site with 50k+ nodes and was wondering why cron kept timing out. I'm obviously not any sort of expert but I honestly feel like if I could miss this, lots of other people could too, and so it's reasonable to make more of an effort to make sure people are aware of this. I'll also note that disabling this indexing from happening was among the features of the deprecated suppress search module, so there does seem to be a demand for this.

I really love this module, and I think this would help even more people love it too :)

jpmckinney’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev

6.x-2.x is EOL. #2 has a patch for 1.x

pwolanin’s picture

This would probably improve the user experience, but I suggest do it after 6.x-1.3 to have more time for testing.

j0nathan’s picture

Subscribing.

aaronbauman’s picture

subscribe, bump

senthiln’s picture

Yes, this will improve user experience.

nick_vh’s picture

Version: 6.x-1.x-dev » 6.x-3.x-dev
Status: Needs review » Needs work

Moving this to 6.x-3.x. I am not sure how drupal 6 would handle this, but I guess we will not be dependent on the core search and basically override the search block and the menu path.

nick_vh’s picture

Status: Needs work » Closed (cannot reproduce)

Not an issue in D7, so also not an issue in D6.3

zeezhao’s picture

Hi - Are you saying no need to set 'Number of items to index per cron run' to "0" manually in D7?

davidwhthomas’s picture

Version: 6.x-3.x-dev » 7.x-1.0-beta9
Status: Closed (cannot reproduce) » Active

Still an issue in Drupal 7.14, apachesolr version 7.x-1.0-beta19

No option to set core search "Number of items to index per cron run" to "0" (options are 10,20,50,100,200 and 500)

Only active search module is "Apache Solr search"
Default search module is "Apache Solr"

The search index fills the database, even though it is not used.

mysql> select count(*) from search_index;
+----------+
| count(*) |
+----------+
|   344404 |
+----------+
1 row in set (0.02 sec)

I'm testing having added

$conf['search_cron_limit'] = 0;

to settings.php, will see how that goes.

davidwhthomas’s picture

Version: 7.x-1.0-beta9 » 7.x-1.0-beta19

Adding:

$conf['search_cron_limit'] = 0;

to settings.php, appears to prevent the double indexing.

Would be nice if core search indexing was disabled automatically though, especially if the only active search module is "Apache Solr search"

nick_vh’s picture

That looks more like a Drupal core problem instead of a Apachesolr problem?

mvc’s picture

Drupal core does not give you the option of enabling the search module but never indexing nodes. I believe this is reasonable on the grounds that you shouldn't let people who don't use solr shoot themselves in the foot and accidentally turn off indexing. It's up to modules like apachesolr which require core's search module but which handle their own indexing to give users a way to disable this.

As I mentioned in comment #8 above, if the user has chosen to override core searches and search_cron_limit is not 0, then this module should display a message on the solr settings page reminding people that search.module is indexing their site and give them the option of turning that indexing off. It doesn't make sense to ask the core module to provide this option.

pwolanin’s picture

Hmm, if disabling node module search does not diable its indexing that's a serious core bug.

pwolanin’s picture

So... according to this code it should not be indexing:

http://api.drupal.org/api/drupal/modules%21search%21search.module/functi...

pwolanin’s picture

I am not able to reproduce the problem in 7.x. In 6.x we probably need to pull in the hacks from the 6.x-1.x branch.

pwolanin’s picture

Version: 7.x-1.0-beta19 » 6.x-3.x-dev
pwolanin’s picture

Category: feature » bug
nick_vh’s picture

I think we only need a warning telling users the core_search is still indexing X amount of documents per cron run. Then it is up to them to disable or leave it enabled.

This is not a bug at all imho. Just a case where you should set the core search settings at a proper disabled value.

nick_vh’s picture

StatusFileSize
new732 bytes

this would fix it I think

nick_vh’s picture

Status: Active » Needs review
nick_vh’s picture

Committed this by accident. But still leaving it as needs review until someone confirms this is ok for him/her

nick_vh’s picture

Status: Needs review » Fixed

Well, I guess it will be re-opened if this is not ok

nick_vh’s picture

Status: Fixed » Closed (fixed)
kopeboy’s picture

I can't disable Core Search.

Option to set the number of item to index has no 0 option.

If I uncheck all of the "Active search modules" the page throws an error ("Your default search module is not selected as an active module.") and I can't save.

I am using Search API Apache Solr and is working ok, but then I enabled the core search for a test, and now I can't disable it. It will continue to index on every cron run.. (minimum option is 10 items per cron run).

kopeboy’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Issue summary: View changes
Status: Closed (fixed) » Needs review
zeezhao’s picture

See above, you can add this to your settings.php to force zero

$conf['search_cron_limit'] = 0;