daudi
04-15-2008, 09:25 AM
This is a spin-off from something else I'm playing with. The built-in iliad search will only search the current directory, and if I'm not mistaken will only search the title field, not the description.
This little script will allow you to search multiple directories and will grep the manifest file. This means you can put key words in the description field and it will match on those.
You specify where to start the search in the run.sh script in the search folder (for now). I have included some examples. It is currently set up to search the whole USB device, but it would be easy to change to search CF or internal memory.
You could even copy the search folder and have one for USB, one for CF, etc. or even for specific folders on your CF, e.g. /mnt/cf/books and another for /mnt/cf/articles.
There is another script for deleting the results. Don't use the built-in delete because this deletes the original files rather than the symlinks. I think thomas posted a better way to do symlinks and I'll try that later.
You enter the search phrase by changing the FIRST LINE of the description field of the search entry. At the moment this is "albert", because that is what I was searching for when testing this. Use the label function to change the description, then click on the search entry.
So, in summary, these are the steps:
get shell access if you do not already have it
unzip search.zip somewhere, e.g. your PC
(change the STARTDIR in search/run.sh to where you want searches to start from--no longer necessary)
copy the whole thing to somewhere on your iliad (anywhere will do)
navigate to the search folder using the contentlister
change the description field to your search expression
click on the "search" entry in the contentlister
when the search is complete you will see a "results" folder
view your results in the results folder
delete the results using the "delete" entry in the contentlister
I started doing this because I think I will soon have a way of tagging and taking snippets from PDFs and plan to store the tags in a tags file in the appropriate PDF container directory and snippets in a snippets file. I want to be able to search for snippets or tags.
The main limitations at the moment are:
no way to search within search results
you have to navigate to the search folder, you can't just get there quickly from anywhere
inelegant way of getting user input
I've tested this a little on my USB key with about 800Mb of files and it did not fall over. Feedback welcome.
Edit: just made a couple of updates to zip file.
Edit: the limit on the number of results is not working. I'll have to look into this.
Edit: new version---quoted search expression to allow spaces
Edit (2008-05-01): new version that I think fixes the spaces in filename problem and adds a path config tool. Also fixed hit limit.
Edit (2008-05-01): Added snippet search tool
This little script will allow you to search multiple directories and will grep the manifest file. This means you can put key words in the description field and it will match on those.
You specify where to start the search in the run.sh script in the search folder (for now). I have included some examples. It is currently set up to search the whole USB device, but it would be easy to change to search CF or internal memory.
You could even copy the search folder and have one for USB, one for CF, etc. or even for specific folders on your CF, e.g. /mnt/cf/books and another for /mnt/cf/articles.
There is another script for deleting the results. Don't use the built-in delete because this deletes the original files rather than the symlinks. I think thomas posted a better way to do symlinks and I'll try that later.
You enter the search phrase by changing the FIRST LINE of the description field of the search entry. At the moment this is "albert", because that is what I was searching for when testing this. Use the label function to change the description, then click on the search entry.
So, in summary, these are the steps:
get shell access if you do not already have it
unzip search.zip somewhere, e.g. your PC
(change the STARTDIR in search/run.sh to where you want searches to start from--no longer necessary)
copy the whole thing to somewhere on your iliad (anywhere will do)
navigate to the search folder using the contentlister
change the description field to your search expression
click on the "search" entry in the contentlister
when the search is complete you will see a "results" folder
view your results in the results folder
delete the results using the "delete" entry in the contentlister
I started doing this because I think I will soon have a way of tagging and taking snippets from PDFs and plan to store the tags in a tags file in the appropriate PDF container directory and snippets in a snippets file. I want to be able to search for snippets or tags.
The main limitations at the moment are:
no way to search within search results
you have to navigate to the search folder, you can't just get there quickly from anywhere
inelegant way of getting user input
I've tested this a little on my USB key with about 800Mb of files and it did not fall over. Feedback welcome.
Edit: just made a couple of updates to zip file.
Edit: the limit on the number of results is not working. I'll have to look into this.
Edit: new version---quoted search expression to allow spaces
Edit (2008-05-01): new version that I think fixes the spaces in filename problem and adds a path config tool. Also fixed hit limit.
Edit (2008-05-01): Added snippet search tool