lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Generating Query
Date Thu, 13 Aug 2009 13:37:52 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. Can you confirm
this by ANDing all of your query words and look if you are getting results? Please let me
know if this works for you.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message