Re: How to properly use Levenstein distance with ~ in Java

2014-10-20 Thread Aleksander Sadecki
Ok, thank you for your response. But why I cannot use '~'?

On 20 October 2014 07:40, Ramzi Alqrainy ramzi.alqra...@gmail.com wrote:

 You can use Levenstein Distance algorithm inside solr without writing code
 by
 specifing the source of terms in solrconfig.xml

 searchComponent name=spellcheck class=solr.SpellCheckComponent
   lst name=spellchecker
 str name=classnamesolr.IndexBasedSpellChecker/str
 str name=spellcheckIndexDir./spellchecker/str
 str name=fieldcontent/str
 str name=buildOnCommittrue/str
   /lst
 /searchComponent

 This example shows the results of a simple query that defines a query using
 the spellcheck.q parameter. The query also includes a spellcheck.build=true
 parameter, which is needs to be called only once in order to build the
 index. spellcheck.build should not be specified with for each request.


 http://localhost:8983/solr/spellCheckCompRH?q=*:*spellcheck.q=hell%20ultrasharspellcheck=truespellcheck.build=true

 lst name=spellcheck
   lst name=suggestions
 lst name=hell
   int name=numFound1/int
   int name=startOffset0/int
   int name=endOffset4/int
   arr name=suggestion
 strdell/str
   /arr
 /lst
 lst name=ultrashar
   int name=numFound1/int
   int name=startOffset5/int
   int name=endOffset14/int
   arr name=suggestion
 strultrasharp/str
   /arr
 /lst
   /lst
 /lst



 Once the suggestions are collected, they are ranked by the configured
 distance measure (Levenstein Distance by default) and then by aggregate
 frequency.



 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/How-to-properly-use-Levenstein-distance-with-in-Java-tp4164793p4164883.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
Pozdrawiam / Best regards
Aleksander Sadecki


How to properly use Levenstein distance with ~ in Java

2014-10-18 Thread Aleksander Sadecki
Hi,

I have got a SOLR instance on my local machine with samples of data. When I
run in myhost:8083/solr/#/mycore/query a query: title:taverna it gives me 4
results. When I make a mistake, for instance: title:taveranx it gives me 0
results but with '~' it finds all of the 4 samples which have been found
before.

I am trying to add Levenstein distance in my Java code.

I have got a piece of code:

import org.apache.solr.client.solrj.SolrServer;
// ...
private SolrServer solrServer // ...
QueryResponse originalResponse = solrServer.query(solrQuery);

here you can find how my variable solrQuery looks
like:http://oi59.tinypic.com/izmiwk.jpg

and no documents have been found.

I found queries which have been executed in SOLR and it looks like this:

Oct 18, 2014 7:02:11 PM org.apache.solr.core.SolrCore execute

INFO: [aos] webapp=/solr path=/select
params={spellcheck=truespellcheck.collateExtendedResults=truetie=0.1spellcheck.maxCollations=4spellcheck.maxCollationTries=1000qf=tags^11.0+title^10.0+...q.alt=*:*wt=javabinspellcheck.collate=trueversion=2rows=10defType=dismaxfl=*bq=type:some_field^100start=0q=taveranx~bf=recip(ms(NOW,publication_date),1.15e-08,3650,3650)spellcheck.count=20qt=dismaxfq=-status:Cfq=-(-startDate:[NOW+TO+*]+AND+type:some_field)fq=-type:listing}
hits=0 status=0 QTime=22

Oct 18, 2014 7:02:11 PM org.apache.solr.core.SolrCore execute

INFO: [aos] webapp=/solr path=/select
params={spellcheck=truefacet=truespellcheck.collateExtendedResults=truetie=0.1spellcheck.maxCollations=4spellcheck.maxCollationTries=1000qf=tags^11.0+...q.alt=*:*wt=javabinspellcheck.collate=trueversion=2rows=0defType=dismaxfl=*bq=type:some_field^100start=0q=taveranx~bf=recip(ms(NOW,publication_date),1.15e-08,3650,3650)facet.field=typespellcheck.count=20qt=dismaxfq=-status:Cfq=-(-startDate:[NOW+TO+*]+AND+type:some_field)}
hits=0 status=0 QTime=29

Can someone tell me where could be a mistake?

Thank you in advance
Alex