Hi guys,
    I have a standard query that searches across multiple text fields such as
q=title:iphone OR bodytext:iphone OR title:firmware OR bodytext:firmware

This comes back with documents that have iphone and firmware (I know I
can use dismax handler but it seems to be really slow), which is
great.  Now I want to give some more weight to more recent documents
(there is a dateCreated field in each document).

So I've modified the query as such:
(title:iphone OR bodytext:iphone OR title:firmware OR
bodytext:firmware) AND _val_:"ord(dateCreated)"^0.1
URLencoded to 
q=(title%3Aiphone+OR+bodytext%3Aiphone+OR+title%3Afirmware+OR+bodytext%3Afirmware)+AND+_val_%3A"ord(dateCreated)"^0.1

However, the results are not as one would expects.  The first few
documents only come back with the word iphone and appears to be sorted
by date created.  It seems to completely ignore the score and use the
dateCreated field for the score.

On a not directly related issue it seems like if you put the weight
within the double quotes:
(title:iphone OR bodytext:iphone OR title:firmware OR
bodytext:firmware) AND _val_:"ord(dateCreated)^0.1"

the parser complains:
org.apache.lucene.queryParser.ParseException: Cannot parse
'(title:iphone OR bodytext:iphone OR title:firmware OR
bodytext:firmware) AND _val_:"ord(dateCreated)^0.1"': Expected ',' at
position 16 in 'ord(dateCreated)^0.1'

Thanks,
Sammy

Reply via email to