If you want to search users with ApacheSolr module you can do steps described below.

1) download last snapshot of ApacheSolr module (multientity branch) and then extract it:
http://drupalcode.org/project/apachesolr.git -> choose multientity head -> download snapshot of last commit

2) apply patch below (changes that I made to make working version of this module)
http://drupal.org/files/apachesolr_indexer.module.patch

3) enjoy your Drupal 7 with ApacheSolr user search

this works for me. and I hope that this helps for someones also :)

Comments

internetdevels’s picture

StatusFileSize
new8.78 KB

New patch below

BeaPower’s picture

Any for drupal 6 dev? Thanks.

presleyd’s picture

I get the following error at /admin/config/search/apachesolr/indexer/bundles

Notice: Undefined index: apachesolr in apachesolr_indexer_config_form() (line 216 of /www/mysite_path/sites/all/modules/apachesolr/apachesolr_indexer/apachesolr_indexer.admin.inc).

The number of entities it finds to index seems too low as well. I selected users and several content types and have 249 users and 72 pieces of content currently. It found 129 documents total.

ChrisFlink’s picture

Is this the way to go for user search?
It seems to be future development incompatible because the multi-entity branch looks abandoned?

Looking at schema.xml it seems that should support multiple entities

   <!-- entity_type is 'node', 'file', 'user', or some other Drupal object type -->
   <field name="entity_type" type="string" indexed="true" stored="true" required="true" />

Wouldn't adding a function apachesolr_user_to_document($node, $namespace) based on apachesolr_node_to_document($node, $namespace) be a better idea? (or maybe extracting the global functionality like indexing of field to a function apachesolr_entity_to_document($type, $content, $namespace)?)

Or is the search_api module with a solr backend a better alternative?

eescribano’s picture

I have followed these steps and it has been impossible to index correctly the data.

There is a new tab called "indexing" and there I select only blog and user and I re-index the content and it indexes all content types but the entity users.

Is there a way to index differently? I have tried to run crons to index the content and that gives me an error.

Recoverable fatal error: Argument 1 passed to field_apachesolr_indexer_document_build() must be an instance of ApacheSolrDocument, null given in field_apachesolr_indexer_document_build() (regel 750 van /home/eescribano/src/oostnv_intra_apachesolr/sites/all/modules/contrib/apachesolr/apachesolr_indexer/apachesolr_indexer.module).

Could you please say which versions of apache solr server, apachesolr multientity, and drupal do you have installed so I can try to make it work in my instance?

Thanks in advance!

nick_vh’s picture

InternetDevels.Com I think you will have to reroll this patch against the most current version of Apache Solr (7.x-1.x) and also make sure that you don't include rewrites in your patch that are not related to the functionality that you'd like to add. I do understand that it is confusing with the different versions. Maybe you could even consider closing this thread and follow up on http://drupal.org/node/966796 ?

The patch that I see here doesn't give me a crisp idea on how to add users to the index. I think a function apachesolr_user_to_document($user, $document) would be a more reasonable approach as well but I haven't got into deep research about this.

Could you also explain why you would rename some of the things?
- * @param Apache_Solr_Document $document
+ * @param ApacheSolrDocument $document

Note: I haven't seen they did that in the other patch. Please join the other issue to prevent confusions

pwolanin’s picture

Status: Needs review » Closed (duplicate)

to reiterate, this is duplicate - please join the other issue

presleyd’s picture

@pwolanin
You aren't reiterating here in this issue at least. What other issue? Link to the duplicate would be ideal.

ChrisFlink’s picture

@presleyd issue: #966796: Separate indexer for multiple entity types as mentioned by Nick_vh.
I moved to that topic and for me it is ok to close this one.

forestmars’s picture

Anyone randomly finding this should probably know about apachesolr_user