lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AHMET ARSLAN <iori...@yahoo.com>
Subject Re: Generating Query
Date Thu, 13 Aug 2009 13:34:22 GMT
> hm...try tat...but doesn't seems to be working for me though

Discarding lengthNorm didn't work for you. Very interesting. I am not sure but I think inverse
document frequency causing problem to you. Probably one of query word (very common word) has
high document frequency, and the docs having other query words are getting higher rank. Or
one your query word (very rare word) has very small document frequency, and docs having only
that word are getting higher rank.

You can override another method (idf) of Similarity to ignore idf as well as lengthNorm.

public float idf(int docFreq, int numDocs) {
    return 1.0f;
  }
public float lengthNorm(String fieldName, int numTerms) {
    return 1.0f;
  }

Ofcourse this modifications will cause some side-effects but probably you will see all of
your query words in the first document. If such document exists in your index. Please let
me know if this works for you.


      

---------------------------------------------------------------------
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