Hi, I am trying like this in my code but control is going in catch instead of try block
else { //if (LOG.isInfoEnabled()) //LOG.info("Document " + url + " has no OBJECT links."); try{ //LOG.info("Document " + url + " has no OBJECT links."); surl1=url.toString(); String indexDir="E:\\eclipse\\310307\\objtest\\crawl-result\\index"; FSDirectory directory = FSDirectory.getDirectory(indexDir,true); //LOG.info("Document " + directory + " is the DIRECTORY VALUES."); IndexReader reader = IndexReader.open(directory); if(true){ System.out.println("The value of Deleted Document is " +directory); Term term = new Term("url", surl1); int deleted = reader.deleteDocuments(term); } directory.close(); reader.close(); } catch(Exception e){System.out.println("Exception Found In Block");} //IndexReader ir=new IndexReader(dir); //setNonObjectUrl(surl1); //return surl1; } return doc; can you brief me where did I go wrong?? Ratnesh, V2Solutions India Otis Gospodnetic wrote: > > Hi Ratnesh, > > 1. There is no need to use that many question marks, really. > 2. Use java-user list, not java-dev > 3. You cannot delete using negative criteria. You can delete 1 Document > using its document ID, or you can delete 1 or more Documents using a Term > where you specify a field name and a value. So, you can delete all > Documents that have a field X with value Y, but you cannot delete > Documents that do *not* have a value Y in field X. > > This must be in the FAQ, is it not? > > Otis > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . > Simpy -- http://www.simpy.com/ - Tag - Search - Share > > ----- Original Message ---- > From: "Ratnesh,V2Solutions India" <[EMAIL PROTECTED]> > To: java-dev@lucene.apache.org > Sent: Friday, April 6, 2007 9:39:23 AM > Subject: IndexReader.deleteDocuement(); How to use it with our code?? > > > HI, > I have written a plugin which finds out "object" tags url and store it in > the index with "objects" fields. > I am intrested in getting only those url's which has "object" tag but > instead I get all the urls to be indexed. > > So what I want is to delete some unwanted urls which don't have "object" > tag. > > So how shall I do it?? > > Can nybody help me resolving this issue??? > > > Ratnesh, V2Solutions India > -- > View this message in context: > http://www.nabble.com/IndexReader.deleteDocuement%28%29--How-to-use-it-with-our-code---tf3536867.html#a9872410 > Sent from the Lucene - Java Developer mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Re%3A-IndexReader.deleteDocuement%28%29--How-to-use-it-with-our-code---tf3537305.html#a9882808 Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]