On 20-Nov-08, at 12:23 PM, Manepalli, Kalyan wrote:

Hi,

           I want to fetch only the documents which have a certain
field.

For this I am using a fq query like this

fq=rev.comments:[* TO *]



rev.comments fields is of type string.

The functionality works correctly but I am seeing a performance
degradation

Without the above fq, the QTime is around 300ms

With fq, the QTime jumps to 850ms



Is there any known issue with range query on String fields

Is there any other efficient way to do this.

This is an inverted index at its worst, unfortunately (to look for an empty field, you are enumerating every possible value of that field and excluding the docs containing it).

The solution is to store a token indicating that the field is empty, such as "<nocomment>" (I think that "" works too). Then change your fq to

fq=-comments:"<nocomment>"

It should be much faster.

-Mike

Reply via email to