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 Mo...@iflexsolutions.com on 2008/02/28 07:58:38 UTC

Query regarding usage of Lucene - Filtering folders

Hi

I would like to join java-user mailing list.

I had a query regarding usage of lucene.

 

 

I have done the indexing for the files kept in root folder -> subfolder

-> subfolder structure.

 

 

When I make the search with particular word it returns me the list of
matching files across the folder structure right from root to the last
subfolder.

 

 

I want to restrict search to specific folder only.

 

Is it possible with lucene?

 

If yes, please suggest me the steps to follow.

 

 

Thanks,

 

Mohammad

 

 



DISCLAIMER:
This message contains privileged and confidential information and is intended only for an individual named. If you are not the intended recipient, you should not disseminate, distribute, store, print, copy or deliver this message. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The sender, therefore,  does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version.

Re: Query regarding usage of Lucene - Filtering folders

Posted by Erick Erickson <er...@gmail.com>.
Sure, but you have to make it happen. The most straight-forward thing I
can think of is to index (probably UN_TOKENIZED) the
path to the file in a new field when you index the contents.
 Then you can easily restrict things however you want by
including an AND clause with the path fragment you wish to restrict your
search to....

Best
Erick

On Thu, Feb 28, 2008 at 1:58 AM, <Mo...@iflexsolutions.com> wrote:

> Hi
>
> I would like to join java-user mailing list.
>
> I had a query regarding usage of lucene.
>
>
>
>
>
> I have done the indexing for the files kept in root folder -> subfolder
>
> -> subfolder structure.
>
>
>
>
>
> When I make the search with particular word it returns me the list of
> matching files across the folder structure right from root to the last
> subfolder.
>
>
>
>
>
> I want to restrict search to specific folder only.
>
>
>
> Is it possible with lucene?
>
>
>
> If yes, please suggest me the steps to follow.
>
>
>
>
>
> Thanks,
>
>
>
> Mohammad
>
>
>
>
>
>
>
> DISCLAIMER:
> This message contains privileged and confidential information and is
> intended only for an individual named. If you are not the intended
> recipient, you should not disseminate, distribute, store, print, copy or
> deliver this message. Please notify the sender immediately by e-mail if you
> have received this e-mail by mistake and delete this e-mail from your
> system. E-mail transmission cannot be guaranteed to be secure or error-free
> as information could be intercepted, corrupted, lost, destroyed, arrive late
> or incomplete or contain viruses. The sender, therefore,  does not accept
> liability for any errors or omissions in the contents of this message which
> arise as a result of e-mail transmission. If verification is required,
> please request a hard-copy version.
>