elasticsearch - Elastic Wild card search not working with space -
i trying make search elastic search index, using wildcard filter, working till use "space" in search criteria.
ex : if value in elastic index "this test value"
when use search value : "this*" --> working, fetching value when use search value : "this is*"--> not working, resulting in 0 match
my code looks follows
querybuilders.wildcardquery(
elasticsearchutil.fieldname, searchvalue.tolowercase())
how can handle space , make search successful?
regards ui
the wildcard query works single token. trying find 1 token followed token second token being specified prefix. can achieved using match phrase prefix query. query this:
querybuilders.matchphraseprefixquery(elasticsearchutil.fieldname, searchvalue)
please note searchvalue shouldn't have "*" @ end.
Comments
Post a Comment