lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Hamilton" <jlhamil...@kbsi.com>
Subject RE: search a subdirectory (New to Lucene)
Date Thu, 23 Feb 2006 17:47:17 GMT
I reindexed with the path as a keyword field and now the PrefixQuery filter does exactly what
I need.  Thanks!

I'm going to hold off on the paragraph-level indexing for now, but that does sound interesting.

many thanks,

John

-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com]
Sent: Wednesday, February 22, 2006 3:18 PM
To: java-user@lucene.apache.org
Subject: Re: search a subdirectory (New to Lucene)


I presume by saying "subdirectory" you're referring to filesystem  
directories and you're indexing a directory tree of files.   If you  
index the path (perhaps relative from the root is best) as a keyword  
field (untokenized, but indexed) you could perform filtering on a / 
path/subpath sort of way using PrefixQuery.

As for paragraphs - how you index a "document" is entirely  
application dependent.  Maybe it makes sense to parse the documents  
before handing them to Lucene such that you're creating a Lucene  
Document for each paragraph rather than for each entire file.   
Slicing the granularity of a domain into Documents is a fascinating  
topic :)

	Erik


On Feb 22, 2006, at 1:00 PM, John Hamilton wrote:

> I'm new to Lucene and was wondering what is the best way to perform  
> a search on a subdirectory or subdirectories within the index?  My  
> thought at this point is to build a query to first search for files  
> in the required directory(ies) and then use that query to make a  
> QueryFilter and use that QueryFilter in the actual search.  Is  
> there an easier way?
>
> On an unrelated note, does anybody know of a way to get results a  
> the section level within a document?  For example, could I find not  
> just a document that matches my query, but the paragraph within  
> that document that best matches the query?
>
> thanks,
>
> John


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