Skip to main content
Topic: Search for attachments?  (Read 2457 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Search for attachments?

Hello,

I wonder if it is possible to search for attachments?

Say, my attachment has a title like "xumqud.pdf" and I want to find it with the search, it doesnt work.

Optimally I could, in Advanced Search Dialogue, check for [ ] attachment title.

Did I overlook something? Or does it really not work at all?

Kind regards,
Esteffano

Re: Search for attachments?

Reply #1

Nope, as far as I remember there is no option to search for attachment names.
I guess it could be helpful at times. Spuds is the one that knows better the search engine, so he can have a better idea of how difficult it could be to implement such a search.
Bugs creator.
Features destroyer.
Template killer.

Re: Search for attachments?

Reply #2

Thanks @emanuele .

@Spuds Do you think it could be implemented?

I could help maybe, but better first ask someone who is familiar with the code.

Kind regards,
Esteffano


Re: Search for attachments?

Reply #3

I think in theory yes it could be implemented ... but there are a few things we need to consider.

If you are using the basic full text index built in to mySQL then an index on the attachment name column would need to be done and probably just a simple OR added to that query.  I don't think you would be able to really effect relevance in this case.

For Elk indexed querys,  you should be able to join in the attachment table and simply add the attachment name to the word index.  That would make that word seem just like it was entered into the body text of the message.  Would have to come up with some updated "highlighted" hits if the hit was really in the attachment table.   Its a bit of a cheat but I think it could work.

Sphinx would also have to have its query(s) updated to add the attachment data.

The above is all for creating.  What I'm not sure about is the modification (adding, removing) of just attachments and how to update those indexes scratch head

Re: Search for attachments?

Reply #4

One maybe simpler option could be to search only the attachment names, somehow like the "Search in topic subjects only"?
That would indeed not change the need for an index, sure.

ETA: unless you are already talking about it so...
 emanuele messed up. :P
Bugs creator.
Features destroyer.
Template killer.

Re: Search for attachments?

Reply #5

Thanks for the input @Spuds‍ 

I think the option @emanuele‍ writes about is a good one.

Quote from: emanuele – One maybe simpler option could be to search only the attachment names, somehow like the "Search in topic subjects only"?
That would indeed not change the need for an index, sure.
Just looking for the file names, when "search attachment names only" is checked.
I don't think these searches should be indexed somehow. Just searching the [tt]attachments[/tt] table.
However, there should be a check that the person who searches only gets results based on their membergroup (only those attachments that are uploaded in boards he has access to).

Quote from: Spuds – Sphinx would also have to have its query(s) updated to add the attachment data.
What is this "Sphinx" generally doing?
Sorry, I had only a brief glance on the files associated with the search engine.

Kind regards, 
Esteffano