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

    Default Edit TopfieldDocs in Lucene

    Hi,

    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 = multiSearcher.search(query, filter, request.getHitStart() + request.getMax(), sortByDate);
    if (count==0) //count is the number of times query occurs in the document
    {
    delete from topFieldDocs;
    }
    else 
    {
    // Display Result
    }
    Thank You for the help
    Last edited by naaser; 12-28-2012 at 04:55 AM.

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

Similar Threads

  1. Replies: 2
    Last Post: 02-22-2012, 10: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, 05:33 AM
  3. Edit .jar
    By jwerre in forum New To Java
    Replies: 1
    Last Post: 10-04-2009, 04:35 AM
  4. Edit a .jar?
    By JuBe in forum New To Java
    Replies: 4
    Last Post: 09-15-2009, 11:07 PM
  5. Edit Command
    By viji83 in forum New To Java
    Replies: 1
    Last Post: 08-15-2008, 03: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
  •