lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: search problem
Date Tue, 25 Apr 2006 17:41:45 GMT

: Problem: while there is a hit, only the timestamp and ip of the very first
: line in the logfile are shown, but not the "matching" ip and timestamp later
: in the logfile. Any suggestions how to get to the "right entries" ?

It sounds like you are creating one Document per logfile, and then using
either Document.get(fieldName) or Document.getField(fieldName) to pull out
the stored ip and timestamps.

(if i'm wrong please clarify)

Assuming you are putting all of the timestamps and ips from the logfile
into your Document when you index it, you could get all of the unique
valeues for field using Document.getValues(fieldName) or
Document.getFields(fieldName) -- but that oesn't really solve your problem
of knowing which one corrisponds to the line that matched.  Lucene can't
tell you that.

If the smallest unit of data you want information about is a single line
from your logfile, then perhaps you should make one document per logline
-- that way when you get a hit, you'll knoew exactly why you got that hit.

if sometimes you do queries where you want to know the specifics from the
logline, and in other cases you just want to know which files match, then
you can allways have two different kinds of documents -- one representing
a logfile and another representing a logline.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message