Hi,

Is there a way to create a file search that looks for files only in the public folder? We would like to set it up on a site which has both private and public files but we don't want private files to get indexed on the search results. We are using the file entity module as well. Anybody achieved this before. Thanks.

Comments

Sohal Khatwani created an issue. See original summary.

drunken monkey’s picture

Status: Active » Fixed

I haven't worked that much with file entities, so I'm not sure. It doesn't seem like it, though, at a glance. What you'd most likely have to do is write a small data alteration plugin to either add a boolean "is public" property (see SearchApiAlterAddUrl for an example) or just remove all files in the private folder during indexing (see SearchApiAlterNodeStatus for an example).
Either of those might be handy to others, too, so if you end up implementing either of this, feel free to re-open this issue as a feature request (or open a new one) and post it as a patch. (As for how to distinguish public from private files: probably look at the URI? Not sure myself.)

Without custom code, though, I don't think it's possible, or at least I wouldn't know, how.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

pandaski’s picture

Wrote a data alteration plugin regarding this issue

Pls help for your kindly review and test so I can improve it, thanks