Hi,

I think i'm reading he question differently then Grant -- his suggestion applies when you are searching in the description field, and don't want documents with shorter descriptions to score higher when the same terms match the same number of times (the default behavior of lengthNorm)

my udnerstanding is that you want documents that don't have a description to score lower then documents that do -- and you might be querying against completely differnet fields (description might not even be indexed)

in that case there is no easy way to to achieve this with just the description field ... the easy thing to do is to index a boolean "has_description" field and then incorporate that into your query (or as the input to a function query)

You get my point Hoss. In my case long description = good value. And your intuition is amazing ;-) I do have a field which is not used in search at all (image url) but docs with image have for me greater value than without it.

I would add two fields then (boolean for photo and int for description length) fill them up during indexation and would play with them during the search.

Thanks,
Tom

Reply via email to