Results 1 to 3 of 3
  1. #1
    greekman123 is offline Member
    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Exclamation Searching in Lucene with Java

    Hi,

    I'm new to Lucene 3.6.1 and Java general. I'm trying to put together a basic app to search pdf files, and am going through a example
    I found on Google:

    [URL="http://www.ehow.com/how_7607733_index-search-pdf-java-lucene.html"]

    I've added: lucene-core-3.6.1.jar to the build path.

    My initial attempt is fairly simple:

    Java Code:
    import org.apache.lucene.analysis.standard.StandardAnalyzer;
     import org.apache.lucene.index.IndexWriter;
    
    
    public class PDF {
    
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    
    		IndexWriter myWriter = new IndexWriter("index", new StandardAnalyzer(), true);
    		}
    
    }

    The problem I'm facing, is I'm getting: The constructor IndexWriter(String, StandardAnalyzer, boolean) is undefined

    Very confused at this point, any help you could offer would be appreciated.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,304
    Rep Power
    20

    Default Re: Searching in Lucene with Java

    If this is the API for the class used, I don't see a constructor that accepts those parameters.
    https://lucene.apache.org/core/3_6_1...dexWriter.html

    Maybe you need to go through this tutorial Lesson: Classes and Objects (The Java™ Tutorials > Learning the Java Language)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default Re: Searching in Lucene with Java

    The first place to start should be the API: does that constructor exist in the API?
    IndexWriter (Lucene 3.6.1 API)
    The tutorial in the link you gave to ehow is quite poor that it is quite plausibly using old versions (2 or below) of Lucene and does not state what version it is using (and is most likely using a very old version).

Similar Threads

  1. help searching withing a site java
    By tamir146 in forum New To Java
    Replies: 3
    Last Post: 09-09-2012, 01:56 PM
  2. Replies: 0
    Last Post: 02-25-2011, 08:13 AM
  3. java searching from many files
    By manish250 in forum Advanced Java
    Replies: 0
    Last Post: 12-31-2010, 07:50 AM
  4. OOM error while searching in lucene
    By formadhukar in forum Lucene
    Replies: 2
    Last Post: 03-30-2010, 05:39 AM
  5. Lucene indexing ans searching code needed
    By vgarg80 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 06-07-2008, 11:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •