You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by reis3k <bo...@hotmail.com> on 2010/12/02 14:34:42 UTC

Using metadata of the requested files with Lucene

Hi All,
I'm trying to write a small app, ebook organizer, using Lucene.

I index metadata of various file types properly,and when I search a keyword
related to metada of documents I can get a result. However, I wanna get the
metadata of some specific indexed document e.g. I'll send the part/filename
to lucene, and it will return exact result including metadata of it. I
couldn't figure out until now. Any help is appreciated. Thanks!
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Using-metadata-of-the-requested-files-with-Lucene-tp2005913p2005913.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Using metadata of the requested files with Lucene

Posted by Ian Lea <ia...@gmail.com>.
You need to store the data in the index (Field.Store.YES) and then you
can get it back by calling doc.get("fieldname").


--
Ian.


On Thu, Dec 2, 2010 at 1:34 PM, reis3k <bo...@hotmail.com> wrote:
>
> Hi All,
> I'm trying to write a small app, ebook organizer, using Lucene.
>
> I index metadata of various file types properly,and when I search a keyword
> related to metada of documents I can get a result. However, I wanna get the
> metadata of some specific indexed document e.g. I'll send the part/filename
> to lucene, and it will return exact result including metadata of it. I
> couldn't figure out until now. Any help is appreciated. Thanks!
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Using-metadata-of-the-requested-files-with-Lucene-tp2005913p2005913.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Using metadata of the requested files with Lucene

Posted by Erick Erickson <er...@gmail.com>.
An example would help. But assuming you've indexed the part or
filename (and that it's unique), just search for it. You should
only get a single document back and then IndexReader.doc(luceneID)
will get you the stored for that document.

You have to watch out for tokenization of file names (use KeywordAnalyzer
perhaps).

Or you can just go to the term/doc directly, see TermDocs.

Best
Erick

On Thu, Dec 2, 2010 at 8:34 AM, reis3k <bo...@hotmail.com> wrote:

>
> Hi All,
> I'm trying to write a small app, ebook organizer, using Lucene.
>
> I index metadata of various file types properly,and when I search a keyword
> related to metada of documents I can get a result. However, I wanna get the
> metadata of some specific indexed document e.g. I'll send the part/filename
> to lucene, and it will return exact result including metadata of it. I
> couldn't figure out until now. Any help is appreciated. Thanks!
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Using-metadata-of-the-requested-files-with-Lucene-tp2005913p2005913.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>