You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Anurag <an...@gmail.com> on 2011/03/19 13:26:14 UTC

How to create patch to implement my own advance search mentioned below

Details
Query will be like "most"{t2,t3,t5,t6,t7} where "most" is linguistic
quantifier having some weights varying b/w a=0.3 and b=0.8
The relevancy matrix with corresponding tf*idf values for the above query is
R(relevancy Matrix)
           t2    t3      t5       t6      t7    
   d1   0.6   0.0    0.4     0.2     0.4
   d2   0.4   0.1    0.7     0.6     0.0
   d3   0.2   0.5    0.0     0.3     0.6
   d4   0.5   0.3    0.5     0.4     0.1
   
Difficulty 1-  How to get the above tf*idf score for all the terms in
relevant document

Using a formulae we can calculate the 5 weights as
w1=0.0,w2=0.2,w3=0.4,w4=0.4,w5=0.0

After calcualting the weights , we can multiply the terms score of each
document with weights in decreasing order( eg. for 1st document- 0.6, then
0.4, 0.4 , 0.2 , then 0.0)

This multiplication of matrix is like
(m*n)*(n*1) ---> n*1 signifies single column matrix of 5 weights defined
above

After multiplication  we get result in matrix with single row called as
Query -relevancy matrix
QR=

d1      0.0*0.6+0.2*0.4+0.4*0.4+0.4*0.2+0.0*0.0
d2      0.0*0.7+0.2*0.6+0.4*0.4+0.4*0.1+0.0*0.0
d3      0.0*0.6+0.2*0.5+0.4*0.3+0.4*0.2+0.0*0.0
d4      0.0*0.5+0.2*0.5+0.4*0.4+0.4*0.3+0.0*0.1
    =
d1       0.32
d2       0.32
d3       0.30
d4       0.38

difficulty 2 - where should i multiply this matrix and add to the solr?

Hence final order of documents on the basis of final score is
0.38>0.32>=0.32>0.30
d4>d1>=d2>d3

Please guide me .


-----
Kumar Anurag

--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-create-patch-to-implement-my-own-advance-search-mentioned-below-tp2701873p2701873.html
Sent from the Solr - User mailing list archive at Nabble.com.