Hi,
We're currently building a large article+photo database, which amongst others include 5-10,000 images. This has presented us with a interesting problem: Finding the right image when browsing the media library.
On each photo, we have three extra fields, photographer
, title
and description
which in our old system, was all searchable. So when the journalists wanted to insert a photo in a article, they'd press the "browse library"-button, search for a keyword or two, and pick a suitable photo as a illustration for the article.
There is no way to recreate this in Media.
So what I'm proposing is some way of adding in search capabilities in the Media library. I don't know how hard it is to get the search module to add in non-node entities.
This search-functionality could have uses outside the "choose media"-popup, as it would allow someone to create ie a photo-sharing site via Media where users can search for other users photos via the content of the fields attached to the image-bundle.
Anyways, I just wanted to get the discussion started. Would anybody else find this useful?
Comment | File | Size | Author |
---|---|---|---|
#36 | media_browser_plus-1038062-search-option-2.patch | 13.88 KB | Sebastian.Buesing |
#33 | media_browser_plus-1038062-search-option.patch | 17.32 KB | Sebastian.Buesing |
#24 | media_basket.jpg | 243.34 KB | ParisLiakos |
#14 | search.png | 209.95 KB | fangel |
#6 | media_browser_plus_2011-02-19_dev.zip | 66.69 KB | Sebastian.Buesing |
Comments
Comment #1
JacobSingh CreditAttribution: JacobSingh commentedYes! Absolutely. check out the Media browser plus project (I moved this issue). We're trying to keep the media module light, and allow addons through other mods. This also helps build a good api. I'm not sure if search belongs in the general media_browser_plus, but it could start there as a sub module and if it takes wings get its own shingle I suppose.
Comment #2
fangel CreditAttribution: fangel commentedCool, didn't know about the Media Browser Plus module. I'll let the issue sit here for a while, and then if nobody with actual knowledge of the browser api tries to implement this, I might give it a shot.
Comment #3
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedHi,
its on my to-do list, but has a low priority for now, so can't promise any dates or anything. There is already a filter, but its rather static and in due time this should be replace with a more convenient one which allows all (in the settings checked) fields to be included in it.
Be sure to to poke me every now and then for status updates ;)
Greetings,
Sebastian
Comment #4
fangel CreditAttribution: fangel commentedWe (as in, the company I work for) wouldn't mind joining in, and contribute patches or however else we could help. As mentioned, we already have a large database of photos that we want to use.. What are your immediate thoughts on how to implement the search?
We've looked into using Search API (http://drupal.org/project/search_api) to maintain the index, and search it. It looks like a decent way to get a separate index for the entities, so it wouldn't accidentally clutter the main site search with Media entities..
Comment #5
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedHi,
I'll have a look at the Search API this evening and come back to you on this. Some help is of course very welcome :).
Greetings,
Sebastian
Comment #6
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedHi,
I have attached a development version (no patch yet) of my latest version of the media_browser_plus module.
This version does include a new Library which uses the same code than the grid view and therefore looks pretty much the same. HOWEVER this feature does not yet work because I need some help on how to pass the items in the "Media Basket" to the next form as it is done in the current library. I tried to understand how the media module does it but I couldn't quite understand it yet.
There are also some other new cool features in this version, but I'd appreciate it if for now we can focus on getting this part done. If I am not mistaken this does only require a skilled Javascript Developer to alter the media_browser_plus.library.js file. Everything else should already be there.
Once this setback is out of the way we can have a look at adding some filtering/search to the new Library.
Greetings,
Sebastian
P.S.: I added some screenshots as an incentive to test this version :-)
Comment #7
fangel CreditAttribution: fangel commentedHi Seb.
Did you post this comment in the wrong issue? I fail to see how it's connected to searching.. It does however look really nice :)
Comment #8
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedHi,
It is connected to searching because I wanted to use this UI to allow the actual searching and you might agree that you can already (with folders and their pages) find/search an image faster than with the regular library.
Comment #9
fangel CreditAttribution: fangel commentedI agree that it's indeed easier to find images when you have a folder-structure. However:
But when I say "search" I mean "have a textfield in which users can enter a search-term, and then get a list of results", not "have some way of manually organizing X images in Y folders which you can then browse, and then find the one you want".
In our existing database we already have the option of organizing things in folders. No one uses it because it's much more convenient to just give it a title and a description and then have a fulltext search option though those fields than it is to also specify a folder and then when you want find it, remember which folder you placed it in and browse your way to it, only to have that folder contain hundreds of files..
And if you would prefer a use-case example:
Say you have a image database consisting of amongst others, 1,000 portraits of CEOs (which shouldn't be a hard image database to compile; think of Techcrunchs). If I want to find Steve Jobs, I want to be able to enter "Steve Jobs" in a search-field and get 1 (perhaps 3) result(s), not browse to "Portraits / CEOs / Tech", and then browse through the 237 pictures of Tech company CEOs to find mr. Jobs..
Comment #10
tazzydemon CreditAttribution: tazzydemon commentedApologies for this message. I cannot delete this post. I did not realise I was hijacking the thread and have reposted.
Julian
Comment #11
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedrenamed it back to old issue name.
Comment #12
fangel CreditAttribution: fangel commentedSebastian, (in case you missed it because of the "derailing") - do you see my point in having fulltext searching besides folder-categorization?
Comment #13
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedHi fangel,
if you want to speed up things with the search and I'm getting a feeling you do :-) than why don't you go into more detail how you would want the search to look like and behave. For instance should there only be one textfield and should that entry search through all fields...etc.
That way when I actually have time to start working on this again I will get it done much faster.
Comment #14
fangel CreditAttribution: fangel commentedHi,
You are correct, I would love to have it done soon :-). Actually, I might give it a stab and try and create a prototype myself. I've attached a mock-up of how a search-field could be added to the existing browser-plus interface.
Basically, my thoughts would be to create a new (separate) Search API index, and have all fields of all media entities added to this index. Possibly some sort of checkbox-interface where you could chose which fields to include.
I'm not thinking of having any clever sort of search (e.g. "items tagged with this taxonomy term"), only full text searching across text (or convertible-to-text) fields.
So enter text, press search, the results come up in the browser with paging etc.. Very basic use-flow, not so simple implementation :-)
PS, perhaps loading all media-entities on module-install to tag them with the root-folder isn't the best idea. I ran out of memory, because I have 5k entities. Perhaps it's possible to use the batch-api to do something clever..
Comment #15
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedPS, perhaps loading all media-entities on module-install to tag them with the root-folder isn't the best idea. I ran out of memory, because I have 5k entities. Perhaps it's possible to use the batch-api to do something clever..
Latest version now performs a batch on hook_enable(). Works fine with a thousand entities ;-)
Comment #16
mstrom81 CreditAttribution: mstrom81 commentedHi there,
I'm new to Drupal and the Media module, and I'm interested in doing something similar to what fangel is.
Right now it seems that the Media library pulls back all items, most recent first. I'm unable to find where in the code it's querying the db. Can anyone please point me in the right direction?
Thanks!
Comment #17
dmsmidtsub
Comment #18
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedMedia Entities are loaded from the DB using "Entity Field Query" right here in this function (media_browser_plus_load_multiple($variables)):
https://github.com/Buesing-Sebastian/Drupal---Media-Browser-Plus/blob/ma...
Does that help you?
Comment #19
mstrom81 CreditAttribution: mstrom81 commentedYes, that helps! Thanks very much, Sebastian.
Comment #20
mstrom81 CreditAttribution: mstrom81 commentedSebastian,
If I'm trying to add search functionality like fangel mentioned above, should I be working off of your Media Browser Plus code from your github? Or can this happen in the Media module itself?
Do you know if anyone is currently working on search functionality within the Media library?
Thanks!
Comment #21
fangel CreditAttribution: fangel commentedAfter playing around with Search API, if you add a index on media entities (in my exampled simply called media_index), you can perform a full-text search and return Media entities using the following:
Knowing this, it should be straight forward to add a new tab to the Media browser with a simple search-field. If you want a better interface / integration into Media Browser Plus etc, it would take a bit more work..
-M
Comment #22
Pocketpain CreditAttribution: Pocketpain commentedSub!
Comment #23
ParisLiakos CreditAttribution: ParisLiakos commentedSubscribing.
I am trying to implement this, but i dont have the best javascript skills around.I have made it to a point but i run onto some problems.
I hope someone implements this
Comment #24
ParisLiakos CreditAttribution: ParisLiakos commenteda suggestion attached
this way we wouldnt need the colorbox and that approach would work without any additional work in the node edit page when selecting image from widget.
Also it means far less clicks for the end user
Comment #25
fedik CreditAttribution: fedik commentedmaybe better make something like the "tags cloud" on top of a files list?
Comment #26
ParisLiakos CreditAttribution: ParisLiakos commentedthat could work too.but has two drawbacks.
people with smaller screens wouldn't have space for two rows of thumbnails
and second it wouldnt be very usable with loads of tags
Comment #27
fedik CreditAttribution: fedik commentedok, then maybe try make "tag cloud" in the collapsed fieldset.
Whay this more liked for me: no need remember what tags someone wrote ;) and find something will be more fast I think
Comment #28
marco_cruz CreditAttribution: marco_cruz commentedHi
Does this module integrate wiht Media Gallery? I cant see the Media Browser Plus when adding items to a gallery...
Also, it would be nice to have Taxonomy!
Comment #29
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedSure it does. If you click on "add media" inside a media gallery you'll see it in the tab "Library Plus". At least you should if you are using the dev version (https://github.com/Buesing-Sebastian/Drupal---Media-Browser-Plus).
Can't follow. Would do you mean?
Comment #30
marco_cruz CreditAttribution: marco_cruz commentedAfter installing Media Browser Plus from github i get the following errors:
"Notice: Trying to get property of non-object in _media_browser_plus_folder_list() (line 1147 of C:\xamp174\htdocs\galeria\sites\all\modules\media_browser_plus\media_browser_plus.module).
Notice: Trying to get property of non-object in media_browser_plus_grid_view_form() (line 1786 of C:\xamp174\htdocs\galeria\sites\all\modules\media_browser_plus\media_browser_plus.module).
Notice: Trying to get property of non-object in _media_browser_plus_folder_list() (line 1147 of C:\xamp174\htdocs\galeria\sites\all\modules\media_browser_plus\media_browser_plus.module)."
Also, I cant see any media files, just the loader's animation...
I'm using: Media 7.x-1.0-beta5, Media Gallery 7.x-1.0-beta6, Plupload integration module 7.x-1.0-beta3
Comment #31
marco_cruz CreditAttribution: marco_cruz commentedI mean categorize a bunch of files with multiple categories (using taxonomy), when uploading and when editing mutiple files
Comment #32
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedCategories will come in 1.0 :
http://drupal.org/node/1300480
As for your error:
Please add:
var_dump($vocabulary);
after each of those:
$vocabulary = taxonomy_vocabulary_machine_name_load('media_folders');
near your errors and show me what you get. I'm assuming your vocabulary is broken or doesn't exist.
Comment #33
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedI have created a patch from the sandbox of slashrsm (http://drupal.org/sandbox/slashrsm/1294592) to add a filter above the "Library Plus". I also did some coding standard improvements and used the multiedit option that is now included inside the media module.
The patch is made against the "github" branch.
Comment #34
heyyo CreditAttribution: heyyo commentedCould we use this patch on the last dev version ?
Comment #35
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedNot yet. It has to updated first ;-)
Comment #36
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedI reworked the patch. Needs review!
Comment #37
ParisLiakos CreditAttribution: ParisLiakos commentedwell the patch introduces some whitespace errors, but beyond that functionality seems good..
EDIT: scratch that i am getting some weird crashes cant find out the reason.seems completely random
Comment #38
dmsmidtI'm testing two (all kinds of things)
What kind of crashes?
It works (almost) for me.
Would be great if the filters on admin/content/media worked that easy.
Activating on hitting enter would help.
If you clear the field, hit "filter". The fieldset will close (looks strange)
I wanted to test further on usability with a filter set and using different folders, but this error is killing me:Fixed super fast by: rootatwchttp://drupal.org/node/1355126
Edit:
I think it is easier to unset the filter after hitting continue. Or show more clearly that a filter is being used.
It feels strange that going to admin/content/media is also filtered if you don't reset it.
Comment #39
ParisLiakos CreditAttribution: ParisLiakos commentedi got them on chrome 14.got the aww snap page.but cant say more since javascript console seems to crash too.
well got it twice and no more.no matter how much i try cant crash it.so maybe it was a chrome bug?w/e just disregard it unless someone else gets it
Comment #40
dmsmidtIt works for me on chrome 16.
Some more notes: I would add a option select: filter all folders | filter active folder
Or something enabling searching all folders at once.
When filter all folders is selected the folder tree could be hidden until reset.
Comment #41
dmsmidtSeems that the patch removes this line from media_browser_plus.info:
dependencies[] = multiform
Comment #42
ParisLiakos CreditAttribution: ParisLiakos commentedindeed..i guess its by accident?
Comment #43
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedHi,
it is not. The media module now comes with it's own multiedit form, so we don't need this anymore. ;-)
Comment #44
bisonbleu CreditAttribution: bisonbleu commentedI know it's been 4 years, but this patch works great when keeping Media 1.x on an existing website is required.
That being said, and with the latest dev (7.x-1.0-beta3+19-dev, dated 2016-02-06), multiform.module is required!