lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven A Rowe" <sar...@syr.edu>
Subject RE: FuzzyQuery + QueryParser - I'm puzzled
Date Mon, 17 Dec 2007 18:00:46 GMT
Hi anjana m,

You're going to have lots of trouble getting a response, for two reasons:

1. You are replying to an existing thread and changing the subject.  Don't do that.  When
you have a question, start a new thread by creating a new email instead of replying.

2. You are not telling the list what you have done and what you want to do.  The information
you provide tells us almost nothing, except that you have tried to use Lucene and failed.

We want to help - really.  But we can't unless you make your questions a) visible by not piggybacking
on existing threads and b) clear by giving a full picture of what you want to do, what you
have tried, and what happened.

Please, try again :).  Start by NOT replying to this message, but instead starting a new thread.

Steve

On 12/17/2007 at 6:24 AM, anjana m wrote:
> hey i amnot bale to comple packages are not found..
> i download..the luncene package..
> help me..
> .lucene.search.Hits;
> import org.apache.lucene.search.Query;
> import org.apache.lucene.document.Field;
> import org.apache.lucene.search.Searcher;
> import org.apache.lucene.index.IndexWriter;
> import org.apache.lucene.document.Document;
> import org.apache.lucene.store.RAMDirectory;
> import org.apache.lucene.search.IndexSearcher;
> import org.apache.lucene.queryParser.QueryParser;
> import org.apache.lucene.queryParser.ParseException;
> import org.apache.lucene.analysis.standard.StandardAnalyzer;
> 
> On Dec 17, 2007 4:34 PM, Doron Cohen <cdoronc@gmail.com> wrote:
> 
> > See in Lucene FAQ:
> >  "Are Wildcard, Prefix, and Fuzzy queries case sensitive?"
> > 
> > On Dec 17, 2007 11:27 AM, Helmut Jarausch
> > <jarausch@igpm.rwth-aachen.de> wrote:
> > 
> > > Hi,
> > > 
> > > please help I am totally puzzled.
> > > 
> > > The same query, once with a direct call to FuzzyQuery
> > > succeeds while the same query with QueryParser fails.
> > > 
> > > What am I missing?
> > > 
> > > Sorry, I'm using pylucene (with lucene-java-2.2.0-603782)
> > > 
> > > #!/usr/bin/python
> > > import lucene
> > > from lucene import *
> > > lucene.initVM(lucene.CLASSPATH)
> > > 
> > > directory = RAMDirectory()
> > > writer = IndexWriter(directory, WhitespaceAnalyzer(), True)
> > > doc = Document()
> > > doc.add(Field("field","Wolfgang Dahmen  Arnold Reusken",
> > >              Field.Store.YES, Field.Index.TOKENIZED))
> > > writer.addDocument(doc)
> > > 
> > > writer.optimize()
> > > writer.close()
> > > 
> > > searcher = IndexSearcher(directory)
> > > 
> > > FQ= True
> > > # FQ= False   # this case doesn't find anything  <+++++  WHY
> > > 
> > > if  FQ :
> > >  # this succeeds in finding the entry above query =
> > >  FuzzyQuery(Term("field", "Damen"),0.79,0) else : # this fails to find
> > >  that entry parser= QueryParser("field",WhitespaceAnalyzer()) query=
> > >  parser.parse("Damen~0.79")
> > > 
> > > hits = searcher.search(query)
> > > print "there are",hits.length(),"hits"
> > > for k in range(0,hits.length()) :
> > >  print hits.doc(k).get("field")
> > > 
> > > --
> > > Helmut Jarausch
> > > 
> > > Lehrstuhl fuer Numerische Mathematik
> > > RWTH - Aachen University
> > > D 52056 Aachen, Germany
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For
> > > additional commands, e-mail: java-user-help@lucene.apache.org
> > > 
> > > 
> > 
>

 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message