php - Cannot search string in elastic search after adding synonym -
i have implemented synonym in elasticsearch facing problem. whole string splited on whitespace , can not search "see result option". here settings.
$indexsettings['analysis']['analyzer'] = array( 'std' => array( // allow query 'shoes' match better 'shoe' stemmed version 'tokenizer' => 'standard', 'char_filter' => 'html_strip', // strip html tags 'filter' => array('standard', 'elision', 'asciifolding', 'lowercase', 'stop', 'length'), ), 'keyword' => array( 'tokenizer' => 'keyword', 'filter' => array('asciifolding', 'lowercase'), ), 'keyword_prefix' => array( 'tokenizer' => 'keyword', 'filter' => array('asciifolding', 'lowercase', 'edge_ngram_front'), ), 'text_prefix' => array( 'tokenizer' => 'standard', 'char_filter' => 'html_strip', // strip html tags 'filter' => array('standard', 'elision', 'asciifolding', 'lowercase', 'stop', 'edge_ngram_front'), ), 'text_suffix' => array( 'tokenizer' => 'standard', 'char_filter' => 'html_strip', // strip html tags 'filter' => array('standard', 'elision', 'asciifolding', 'lowercase', 'stop', 'edge_ngram_back'), ), 'synonym' => array( 'tokenizer' => 'standard', 'type' => 'custom', 'char_filter' => 'html_strip', // strip html tags 'filter' => array('standard','synonym', 'elision', 'asciifolding', 'kstem', 'length','snowball' ,'lowercase', 'stop',) ), ); $indexsettings['analysis']['filter'] = array( 'edge_ngram_front' => array( 'type' => 'edgengram', 'min_gram' => 2, 'max_gram' => 10, 'side' => 'front', ), 'edge_ngram_back' => array( 'type' => 'edgengram', 'min_gram' => 2, 'max_gram' => 10, 'side' => 'back', ), 'stop' => array( 'type' => 'stop', 'stopwords' => '_none_', ), 'length' => array( 'type' => 'length', 'min' => 2, ), 'synonym' => array( 'type' => 'synonym', 'expand' => true, 'synonyms_path' => 'synonyms.txt', ), ); $properties[$key]['analyzer'] = 'synonym';
in dropdown give 5 result show , 1 option see result. on searching of "anti ssl protein" word got q=anti ssl="" like="" protein="" in anchor tag of see result.cant full word see result option.
Comments
Post a Comment