Hi

             The issue of searching file name is resolved with some 
modifications in SearchFiles.java . 
A field named path has been added in the code.
String field = "path";
Also appended parser.setAllowLeadingWildcard(true)  for  searching leading 
wildcard strings, which was not available by default.
If parser.setAllowLeadingWildcard(true)  is set to false the code cant find the 
file name. 
If the file name consists of a string xyz, the query option should have *xyz*. 


Dheeraj KV




-----Original Message-----
From: Dheeraj Kv <dheera...@aol.com>
To: java-user <java-user@lucene.apache.org>
Sent: Wed, Feb 1, 2012 1:10 pm
Subject: Apache Lucene  file search


Hi
        I learnt about Lucene from google and i thought of implementing it my 
company.
I don't want to use Lucene as a web search application. I have a large backup 
storage and which consists of html file, doc files and pdf files.
I need to search inside a file as well as search for file names. For that 
purpose I thought I will try Lucene. I m not good in JAVA. 
I installed  it on the server and it worked me for normal search  inside the 
files, but  found out that file name search is not supported. 
Also it takes the same amount of time for making the index and updating the 
index of the same directory. 
Can you put some light on it. I used IndexFiles and SearchFiles APIsfor this 
purpose. 
Commands I used was:


Indexing
java org.apache.lucene.demo.IndexFiles -index /mnt1 -docs /Documents 


Searching
java org.apache.lucene.demo.SearchFiles -index /mnt1 


Regards

Dheeraj KV


 

Reply via email to