Answer the question
In order to leave comments, you need to log in
Correct search query in elasticsearch?
Please help with the request, there are names and a simple request for them
$request = array(
"from" => 0,
"size"=>1000000,
"query"=> array(
"match"=>array(
"full_description"=>array(
"query"=>$text,
"fuzziness "=> 2,
"prefix_length"=> 1,
)
)
);
$request = array(
"mappings"=> array(
"person"=>array(
"properties"=>array(
"id"=>array(
"type"=> "integer",
"index"=> "not_analyzed"
),
"updated"=>array(
"type"=> "date",
"index"=> "not_analyzed"
),
"full_description"=>array(
"type"=> "string"
)
)
)
));
$request = array("type" => "jdbc",
"jdbc"=>array(
"url" => "jdbc:mysql://localhost:3306/test_m",
"user" => "user",
" password" => "pass",
"sql" => "SELECT id, updated, full_description FROM product_info",
"index"=>"index1",
"type"=>"person"
),
"analysis"=>array(
"analyzer"=> "english"
)
);
$request = array(
"from" => 0,
"size"=>1000000,
"query"=> array(
//"match_all"=>array(""=>""),
"match"=>array(
"full_description"=>array(
//"query"=> mb_convert_encoding($text, "utf-8", "CP1251"), //Encoding crap, elastic accepts utf-8
"query"=>$text,
" fuzziness"=> 2,
"prefix_length"=> 1,
//"min_similarity"=> "0.5"
)
)/*,
"order"=>array(
"max_score"=> "desc"
)*/
)/*,
"analysis"=>array(
"analyzer"=> "english"
)*/
/*,
"sort"=>array(
"updated"=>array(
"order"=>"desc",
"ignore_unmapped " => "true"
)
)*/
);
Answer the question
In order to leave comments, you need to log in
If I understand correctly, you just use stemming. Need morphology, here is the plugin
https://github.com/imotov/elasticsearch-analysis-m...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question