On 24/08/06, Mag Gam <[EMAIL PROTECTED]> wrote:
Is it possible to get Document Name, instead of its entire path?
Currently, i have something like this:
out.println (doc.get ("path")); // Which gives me /documents/file.txt
doc.get("path").split("/")[doc.get("path").split("/").length - 1]
--
If you want to get "file.txt" out of "/documents/file.txt" simply cut of
everything before the last "/":
String path = doc.get("path");
String name = path != null ? path.substring(path.lastIndexOf("/") + 1) :
path;
Otherwise, if you want to store only the name in the index, you will have to d
Index the "filename" when you are indexing as you did the "path". You
can get it back with doc.get("filename");
suba suresh.
Mag Gam wrote:
Is it possible to get Document Name, instead of its entire path?
Currently, i have something like this:
out.println (doc.get ("path")); // Which gives
It is up to you. What ever you put in the document during indexing
you'll get back. If you'll add a field of just the document name you can
retrieve that, or just parse the file name from the path.
Aviran
http://www.aviransplace.com
-Original Message-
From: Mag Gam [mailto:[EMAIL PROTEC