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 vijay reddy <vk...@hotmail.com> on 2010/05/18 08:57:19 UTC

Using Lucene to Query File properties in Windows



    
        



    
    
                  
            
                Hi ,




I am planning to use Apache lucense in one of my projects, I want to 
index files based on the file properties (I won’t be indexing the data) 
and I want lucense to query the index so that I can quickly find list of
 files to based on the properties .




E.g: give me all the files with access time greater than 10/10/2005 
and access time less than 10/04/2010 and file created by james.




Can i use Lucene  for these kind of projects ?




does Lucense supprot queries like above ?



             		 	   		  
_________________________________________________________________
The amazing world in sharp snaps
http://news.in.msn.com/gallery/archive.aspx

Re: Using Lucene to Query File properties in Windows

Posted by Ian Lea <ia...@gmail.com>.
Sure. Create an index with fields like

name: somefile.whatever
creator: james
lastmod: 20100518
created: 20100518
...

Make sure that the fields that you want to search on are indexed,
create some queries and away you go.  You'll need range queries for
the before and since tests.


Good luck.

--
Ian.


On Tue, May 18, 2010 at 7:57 AM, vijay reddy <vk...@hotmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>                Hi ,
>
>
>
>
> I am planning to use Apache lucense in one of my projects, I want to
> index files based on the file properties (I won’t be indexing the data)
> and I want lucense to query the index so that I can quickly find list of
>  files to based on the properties .
>
>
>
>
> E.g: give me all the files with access time greater than 10/10/2005
> and access time less than 10/04/2010 and file created by james.
>
>
>
>
> Can i use Lucene  for these kind of projects ?
>
>
>
>
> does Lucense supprot queries like above ?
>
>
>
>
> _________________________________________________________________
> The amazing world in sharp snaps
> http://news.in.msn.com/gallery/archive.aspx

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


RE: Using Lucene to Query File properties in Windows

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

this works fine with Lucene.
Use NumericField and NumericRangeQuery to index the file date
(File.lastModified as NumericField.setLongValue()).

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: vijay reddy [mailto:vkreddy_in@hotmail.com]
> Sent: Tuesday, May 18, 2010 8:57 AM
> To: java-user@lucene.apache.org
> Subject: Using Lucene to Query File properties in Windows
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>                 Hi ,
> 
> 
> 
> 
> I am planning to use Apache lucense in one of my projects, I want to index
> files based on the file properties (I won't be indexing the data) and I
want
> lucense to query the index so that I can quickly find list of  files to
based on
> the properties .
> 
> 
> 
> 
> E.g: give me all the files with access time greater than 10/10/2005 and
access
> time less than 10/04/2010 and file created by james.
> 
> 
> 
> 
> Can i use Lucene  for these kind of projects ?
> 
> 
> 
> 
> does Lucense supprot queries like above ?
> 
> 
> 
> 
> __________________________________________________________
> _______
> The amazing world in sharp snaps
> http://news.in.msn.com/gallery/archive.aspx


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