lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chaoqing Li <lichaoq...@gmail.com>
Subject sort question
Date Mon, 21 May 2012 10:17:10 GMT
Hi,

I'm using Lucene2.1 to search product information, such as product name,
description, etc.
There is a sort on discount field, the product with discount price should
be at the top of the result page.

example documents:
product1(name: aaa, description: ddd bbb, discount:null)
product2(name: bbb, description: ddd bbb, discount:10%)
product3(name: ccc, description: ddd bbb, discount:20%)

We have a sort field on discount, so the order of search result by keyword
"ddd" is product3 product2 product1.

but we want the products which name include the keyword should be the top
of the result even though they has no discount.
so if search by "bbb",
because the name of product2 include "bbb", the order should be product2
product3 product1.
Any idea to implement it?

Thanks,

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message