Hi Stefy, the stack trace you posted has nothing to do with Apache Lucene. It looks like you are using some commons-lang3 classes here, but no Lucene code at all. So I think your question might be better asked on the commons-math mailing list, unless you have some Lucene code around, too. If this is the case, you should give more information how you use Lucene.
Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Stefy D. [mailto:tsuki_st...@yahoo.com] > Sent: Thursday, March 20, 2014 10:05 PM > To: java-user@lucene.apache.org > Subject: Dimension mismatch exception > > Dear all, > > I am trying to compute the cosine similarity between several documents. I > have an indexed directory A made using 10000 files and another indexed > directory B made using 20000 files. All the indexed documents from both > directories have the same length (100 sentences). I want to get the cosine > similarity between documents from directory A and documents from > directory B. I have used the code from here but on the two indexed > directories. So I use something like getCosineSimilarity(docs_A[i], > docs_B[j]); > > I get the following error: > Exception in thread "main" > org.apache.commons.math3.exception.DimensionMismatchException: > 44,375 != 596,263 > at > org.apache.commons.math3.linear.RealVector.checkVectorDimensions(Real > Vector.java:179) > at > org.apache.commons.math3.linear.RealVector.checkVectorDimensions(Real > Vector.java:165) > at > org.apache.commons.math3.linear.RealVector.dotProduct(RealVector.java:3 > 07) > at NewApp.testCosine.getCosineSimilarity(testCosine.java:57) > > Please help me. Thank you very much! --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org