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

    Exclamation Searching in Lucene with Java


    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:


    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
    Madgaon, Goa, India
    Rep Power

    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.

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

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

    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, 02:56 PM
  2. Replies: 0
    Last Post: 02-25-2011, 09:13 AM
  3. java searching from many files
    By manish250 in forum Advanced Java
    Replies: 0
    Last Post: 12-31-2010, 08:50 AM
  4. OOM error while searching in lucene
    By formadhukar in forum Lucene
    Replies: 2
    Last Post: 03-30-2010, 06: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, 12:31 PM

Posting Permissions

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