Fwd: Highlight part of words


(Alexandre Heimburger) #1

Hi,

Imagine that I query 'andr'

Alexandre and Andre are matching but both terms are fully highlighted. I
would like to hightlight only the letter I typed.

Here is my mapping :

{
"usr" : {
"properties" : {
"title" : {
"type" : "multi_field",
"fields" : {
"title" : {"type" : "string", "index" : "analyzed"},
"raw" : {"type" : "string", "analyzer" :
"lowercase_keyword"}
}
}
}
}
}

Here is the query :

array('query'=>array('bool'=> array(
'must' =>
array("wildcard"=>array('title.raw'=>"$str")),
'should' => $locTerms,
'minimum_number_should_match'=> 1,
'boost' => 1.0
)
),
'highlight' =>
array('fields'=>array('title'=>array('number_of_fragments'=>1)))
);

Any clue ?

Thanks

--
Alexandre Heimburger
R&D Manager
blueKiwi Software
tel : +33687880997
email : ahb@bluekiwi-software.com
adress : 93 rue Vieille du Temple, 75003 Paris

What is blueKiwi? blueKiwi - the first Enterprise Social Software Suite in
the world building professional networks on conversations and relationships

  • helps large organizations increase their productivity, foster innovations
    and boost people satisfaction.

(system) #2