Consider using the dismax query parser instead. It has more
sophisticated capability to spread user queries across multiple fields
with different weightings.
Erik
On Jul 20, 2010, at 4:34 AM, Bilgin Ibryam wrote:
Hi all,
I have two simple questions:
I have an Item entity with id, name, category and description
fields. The
main requirements is to be able to search in all the fields with the
same
string and different priority per field, so matches in name appear
before
category matches, and they appear before description field matches
in the
result list.
1. I think to create an index having the same fields, because each
field
needs different priority during searching.
2. And then do the search with a query like this:
name:search_string^1.3 OR categpry:search_string^1.2 OR
description:search_string^1.1
Is this the right approach to model the index and search query?
Thanks in advance.
Bilgin