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 April06 <ap...@yahoo.de> on 2006/04/25 17:54:07 UTC

search problem

We indexed several logfiles which contain for example a timestamp, an ip and
additional information (all defined as a field) all in one line.
A logfile itself contains many of these lines.

We used a BooleanQuery (timestamp / ip) to search for a ip between a defined
range of time. 

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" ? 

Thank you very much.
--
View this message in context: http://www.nabble.com/search-problem-t1506294.html#a4084844
Sent from the Lucene - Java Users forum at Nabble.com.

Re: search problem

Posted by karl wettin <ka...@snigel.net>.
25 apr 2006 kl. 17.54 skrev April06:

>
> We indexed several logfiles which contain for example a timestamp,  
> an ip and
> additional information (all defined as a field) all in one line.
> A logfile itself contains many of these lines.
>
> We used a BooleanQuery (timestamp / ip) to search for a ip between  
> a defined
> range of time.
>
> 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" ?

First inspect your index using Luke and see if it the expected data  
is there. If not, take a look at your index writing code. Else take a  
look at how you retrieve the data from your index. If you can't  
figure it out, post the code and tell us what the index contains and  
how you expected it to look like.


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


Re: search problem

Posted by April06 <ap...@yahoo.de>.
I guess that fixes the problem.
Thanx
--
View this message in context: http://www.nabble.com/search-problem-t1506294.html#a4096490
Sent from the Lucene - Java Users forum 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: search problem

Posted by Chris Hostetter <ho...@fucit.org>.
: 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.


-Hoss


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