lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Brown <chri...@orangepics.com>
Subject Re: Searching over more than one Fields
Date Sun, 29 Jan 2006 20:19:41 GMT
I'd suggest creating the index a little differently. How about creating each 
paragraph as a document. Each document could have three fields: filename, 
paragraph number and content.

With an index like this you'd be able to easily search one field for the 
content, the hits could report which paragraph and file the content was 
found in, plus you could do paragraph specific searches if you like.

Chris Brown
OrangePics - Simple, Safe Photo Sharing
http://www.orangepics.com/

----- Original Message ----- 
From: "Jairo Sánchez Menéndez" <jairochan82@yahoo.es>
To: <java-user@lucene.apache.org>
Sent: Sunday, January 29, 2006 2:17 PM
Subject: Searching over more than one Fields


> Hi everybody,
>
> Well I will explain you my problem:
> I am indexing ".txt" files and basically I split each file in paragraphs, 
> I mean, i create a Document for each file and within this Document I
> add one Field named "px" for each paragraph (x) of the file.
> My question is: after creating the index, now i want to do searches over 
> the index, but what I want is searching a word over all paragraphs of all 
> files, i.e.
> searching the word in all Fields of all Documents.
> I am using something like this, but doing so i can only put p1 or p2 or p3 
> ... in the Field parameter of the parse method, how can i search over all 
> paragraphs??
> Query query=QueryParser.parse(q, "   ", new WhitespaceAnalyzer());
> Hits hits=is.search(query);
>
> Thanks.
>
>
> ______________________________________________ LLama Gratis a cualquier PC 
> del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. 
> http://es.voice.yahoo.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


Mime
View raw message