Hi, here is problem with QueryString search in cyrillic using Snowball.
When i'm search some word using , Elastic returns no results, where this
word matches, it returns me only results with length, longer than query
word length. For example. I have query word Auto (in russian Авто) and
documents with _source ['name'] => Auto, ['name'] => Automobile, ['name']
=> Automobile showroom. If i search 'Auto' Elastic returns me only
"Automobile" and "Automobile showroom", but not 'Auto'. When i'am using
english versions of this words everything workes fine.
Here is some settings. (Elastica client used, looks simple, but if that
need i can comment some rows).
public static $_elastica = array(
'number_of_shards' => 4,
'number_of_replicas' => 1,
'analysis' => array(
'analyzer' => array(
'indexAnalyzer' => array(
'type' => 'custom',
'tokenizer' => 'standard',
'filter' => array('lowercase', 'mySnowball')
),
'searchAnalyzer' => array(
'type' => 'custom',
'tokenizer' => 'standard',
'filter' => array('lowercase', 'mySnowball', 'stop')
)
),
'filter' => array(
'mySnowball' => array(
'type' => 'snowball',
'language' => 'russian',
),
'stop' => array(
'type' => 'stop',
'stopwords' =>
'а,без,более,бы,был,была,были,было,быть,в,вам,вас,весь,во,вот,все,всего,всех,вы,где,да,даже,для,до,его,ее,если,есть,еще,же,за,здесь,и,из,или,им,их,к,как,ко,когда,кто,ли,либо,мне,может,мы,на,надо,наш,не,него,нее,нет,ни,них,но,ну,о,об,однако,он,она,они,оно,от,очень,по,под,при,с,со,так,также,такой,там,те,тем,то,того,тоже,той,только,том,ты,у,уже,хотя,чего,чей,чем,что,чтобы,чье,чья,эта,эти,это,я',
)
)
)
);
//Here we set it to index
$index->create(self::$_elastica, true);
//And here is when we creating a document
$mapping = new Elastica_Type_Mapping($type, self::$_elastica);
$mapping->setProperties(self::$_elasticaMapping);
$mapping->setParam('index_analyzer', 'indexAnalyzer');
$mapping->setParam('search_analyzer', 'searchAnalyzer');
$mapping->send();
//This is a search field mapping
'name' => array('type' => 'string', '_analyzer' => array('path' =>
'mySnowball'))
//And here is a search query
$query = new Elastica_Query_QueryString('Авто*');
$query->setAnalyzer('searchAnalyzer');