elasticsearch
elasticsearch copied to clipboard
Wildcard search with space character returns ZERO hits
I am having one field with value "ABC XYZ HFE" .. Now If I trying to do the search with wildcard query ' * ABC * ' then that returns me correct hits with perfect document. Now If I am trying to search with wildcard query '* ABC XYZ *' (That kind of wildcard entry is exist in Index->type. But still I am getting wrong ZERO hits (Empty resultset).
Can you please let me know what's going on here. I am placing the syntax for reference. OR please let me know what's the mistake in my syntax, due to that I am not getting proper result set.
Syntax,
$es = Client::connection(array('servers'=>'localhost:9200','index'=>localhost','type'=>'test_type')); $arrayGeneral = array( 'query' => array( 'wildcard' => array('_all' => '* ABC XYZ *'), ), 'from' => 0, 'size' => 10, 'facets'=> $facetCause, 'sort' => $arraySortFields, ); $return = $es->search($arrayGeneral);
Regards.
I think ... Should we have to use "match" phase instead of "wildcard" phase ?
Did you find the solution to this?
I am having the same issue when using 'wildcard' when a space (or non alpha-numeric character) is typed in. (I'm using this to fuel a jQuery auto-complete dropdown)
thx