elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

Wildcard search with space character returns ZERO hits

Open ghost opened this issue 10 years ago • 2 comments

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.

ghost avatar May 28 '14 05:05 ghost

I think ... Should we have to use "match" phase instead of "wildcard" phase ?

ghost avatar Jun 05 '14 09:06 ghost

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

kosso avatar Jan 07 '15 16:01 kosso