Boost when you make a Query

Hi ,

I try to choose the "boost" on my different field when i make a simple
search query my result is not what i'm expect :frowning:

Whit this simple mapping, for exemple :

$mapping->setProperties(array(
'libelle' => array('type' => 'string', 'include_in_all' => TRUE),
'description' => array('type' => 'string', 'include_in_all' => TRUE)
));

I would like to have a better "boost" on my field 'libelle'

'query' => array(
'text' => array(
'libelle' => array(
'query' => $_POST['searchQuery'],
'boost' => 9
)
),
'text' => array(
'description' => array(
'query' => $_POST['searchQuery'],
'boost' => 0.2
)
)
)

If anyone can help me...

Thanx

I've answered on the french mailing list that I use this :

David

Le 28 mai 2012 à 11:26, Vincent GROSS vince.gross@gmail.com a écrit :

Hi ,

I try to choose the "boost" on my different field when i make a simple search query my result is not what i'm expect :frowning:

Whit this simple mapping, for exemple :

$mapping->setProperties(array(
'libelle' => array('type' => 'string', 'include_in_all' => TRUE),
'description' => array('type' => 'string', 'include_in_all' => TRUE)
));

I would like to have a better "boost" on my field 'libelle'

'query' => array(
'text' => array(
'libelle' => array(
'query' => $_POST['searchQuery'],
'boost' => 9
)
),
'text' => array(
'description' => array(
'query' => $_POST['searchQuery'],
'boost' => 0.2
)
)
)

If anyone can help me...

Thanx

It might be that the structure of the query you send is wrong, you need to
wrap a compound query (two text queries) in a bool query (probably you want
should elements).

On Mon, May 28, 2012 at 11:26 AM, Vincent GROSS vince.gross@gmail.comwrote:

Hi ,

I try to choose the "boost" on my different field when i make a simple
search query my result is not what i'm expect :frowning:

Whit this simple mapping, for exemple :

$mapping->setProperties(array(
'libelle' => array('type' => 'string', 'include_in_all' => TRUE),
'description' => array('type' => 'string', 'include_in_all' => TRUE)
));

I would like to have a better "boost" on my field 'libelle'

'query' => array(
'text' => array(
'libelle' => array(
'query' => $_POST['searchQuery'],
'boost' => 9
)
),
'text' => array(
'description' => array(
'query' => $_POST['searchQuery'],
'boost' => 0.2
)
)
)

If anyone can help me...

Thanx