The files are indexed, the data is sent to Acquia and the search returns results as expected.

Only problem is, anonymous users don't see the files search results, even though in the permissions page, Anonymous users are not restricted to obtain results either so I'm wondering what i'm missing.

And the other small detail is when I enable facets and files are among the filtered items (in a block), it says default(x) and I was wondering if there's any way to display something else like Files(x) instead ?

and thank you for the module!

Comments

grzesiek_k’s picture

Priority: Normal » Major

I do have the same problem. Is there a simple solution for that ?

Thank you,
Greg

robbertnl’s picture

Same issue, also with authenticated users

nick_vh’s picture

If you disable apachesolr node access, this should be resolved. But I currently don't have the bandwidth to research as to why. Could you please do a deep-dive and let me know?

robbertnl’s picture

I can confirm disable node access helps. I will take a look

grzesiek_k’s picture

Thank you Nick_vh - it's working now !!!

dan3h’s picture

We also have the same problem. Indexing PDFs in a file field. They show up in searches *UNLESS* you are not logged in. Then searches for text in the PDF doesn't yield any results. (But the PDF field is not restricted -- even when not logged in, you can view the node containing the PDF, and you can click to open the PDF.)

And disabling "apachesolr node access" fixed the problem.

The issue is not really about being logged in or not. At least in our case, it was about having the "Bypass content access control" permission. My admin user had that, and was able to have the PDF come up in search results. When I granted that permission to anonymous users, they too were able to have the PDFs come up in search results.

But I don't want anonymous users to be entirely exempt from access control. Disabling "apachesolr node access" is better, but still seems like a bit of a hack. Is there anything better available yet?

nick_vh’s picture

Can someone make a patch for this?

acrosman’s picture

There is a patch that was offered on a similar ticket under the Apache Solr User module: https://drupal.org/node/1665350#comment-7068922. However, it seems to allow too much access. With that patch in place users are able to see snippets for private files they are otherwise unable to open.

acrosman’s picture

Issue summary: View changes

spelling

somebodysysop’s picture

Issue summary: View changes

This patch to apachesolr_attachments gets us pretty close: https://www.drupal.org/node/1782936#comment-8587995

It will only let users see the file if they have access to the node.

However, if there are further restrictions on the file, say field access permissions, they are ignored. So, theoretically, you could still view results from a private file so long as you have access to the node.

I'm willing to take a stab at it if someone could point me in the right direction. It appears that I would have to use something like hook_field_access().

somebodysysop’s picture

The hook to use to process apachesolr search results: hook_apachesolr_process_results()

jamesrward’s picture

If anyone can test I would be very interested to hear if this patch resolves the issue.