lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhanuman kumarbaburavi <V.R...@NIIT-Tech.com>
Subject Prefix And Fuzzy
Date Fri, 19 Mar 2010 15:36:57 GMT
Dear Paul,



Still I am fighting with Prefix and Fuzzy search. Based on archive post I have noticed once
thing i.e. when the prefix search will work only for "Field.Index.NOT_ANALYZED" type. I have
changed that one prefix working perfectly. But the fuzzy search is working stopped, I hope
because of the Index type when I changed to "Field.Index.ANALYZED" it starts working. I am
using "lucene 3.0"version.



I have implemented these two searches in my application following way.



IndexSearcher is = new IndexSearcher(FSDirectory.open(new File("index11")));

is.setSimilarity(Similarity.getDefault());

Analyzer analyzer = new StopAnalyzer(Version.LUCENE_30);

QueryParser parser = new QueryParser(Version.LUCENE_30, "name",analyzer);

parser.setLowercaseExpandedTerms(true);

parser.setEnablePositionIncrements(true);

parser.setAllowLeadingWildcard(true);

parser.setFuzzyPrefixLength(4);

parser.setFuzzyMinSim(0.8f);



BooleanQuery booleanQuery = new BooleanQuery(true);

parser.setAllowLeadingWildcard(true);

booleanQuery.add(parser.parse("Tick*"), BooleanClause.Occur.SHOULD);

booleanQuery.add(parser.parse("Tick~"), BooleanClause.Occur.SHOULD);



ScoreDoc[] hits = is.search(booleanQuery, 1000).scoreDocs;

for (int i = 0; i < hits.length; i++) {

      Document hitDoc = is.doc(hits[i].doc);

      System.out.println(hitDoc.get("name") + "\t" + i);

}



Please suggest me ASAP.



Thanks & Regards



Veera.





-----Original Message-----
From: Paul Taylor [mailto:paul_t100@fastmail.fm]
Sent: Friday, March 19, 2010 5:02 PM
To: java-user@lucene.apache.org
Subject: Version.onOrAfter() complaing its Deprecated but it isnt



Hi since downloading Lucene 3.1 my code complains that

Version.onOrAfter() complaing its deprecated but i also have svn access

to the source and it isn't deprecated , and doesnt look like it ever has

been, anyone else get this ?



Paul



---------------------------------------------------------------------

To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org

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



________________________________
DISCLAIMER

The content of this email and any attachments ('email') is confidential, may be privileged,
subject to copyright and may be read and used only by the intended recipient. If you are not
the intended recipient please notify us by return email or telephone and erase all copies
and do not disclose the email or any part of it to any person. Email transmission cannot be
guaranteed to be secure, or error free as information could be intercepted, corrupted, lost
or destroyed as a result of the transmission process. The sender, therefore, does not accept
liability for any errors, omissions, viruses or delay in transmission as a result of this
mail. We monitor email communications through our networks for regulatory compliance purposes
and to protect our clients, employees and business. Opinions, conclusions, and other information
in this message that do not relate to the official business of NIIT Technologies Ltd. or its
affiliate(s) shall be understood to be neither given nor endorsed by NIIT Technologies Ltd.
or its affiliate(s).

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message