Results 1 to 2 of 2
  1. #1
    naaser is offline Member
    Join Date
    Dec 2012
    Rep Power

    Default Edit TopfieldDocs in Lucene


    I am doing a search using Lucene but for certain phrases I am not getting an exact match. To counter this, I am looking at the number of times the query (phrase to search) occurs in the Document. For documents with "0" hits, I want to delete the entry. How do I do this?
    Java Code:
    //Initiated somewhere in the code
    TopFieldDocs topFieldDocs = null;
    multiSearcher = new MultiSearcher(indexSearchers);
    analyzer = new StandardAnalyzer(Version.LUCENE_34);
    queryParser = new QueryParser(Version.LUCENE_34, "path", analyzer);
    topFieldDocs =, filter, request.getHitStart() + request.getMax(), sortByDate);
    if (count==0) //count is the number of times query occurs in the document
    delete from topFieldDocs;
    // Display Result
    Thank You for the help
    Last edited by naaser; 12-28-2012 at 05:55 AM.

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

Similar Threads

  1. Replies: 2
    Last Post: 02-22-2012, 11:09 AM
  2. Edit jar, see the code, edit code and back it as a jar
    By RichersooN in forum New To Java
    Replies: 1
    Last Post: 10-10-2011, 06:33 AM
  3. Edit .jar
    By jwerre in forum New To Java
    Replies: 1
    Last Post: 10-04-2009, 05:35 AM
  4. Edit a .jar?
    By JuBe in forum New To Java
    Replies: 4
    Last Post: 09-16-2009, 12:07 AM
  5. Edit Command
    By viji83 in forum New To Java
    Replies: 1
    Last Post: 08-15-2008, 04:26 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