Need help for using wildcard query


(AshutoshB) #1

Hi All,

We are using Java API of elasticsearch(0.19.1) for our application. I want
to store a document field with value "1-d:3.4.5" and then want to search
for the document having the value of the field "starts with 1 and end with
4.5". I tried to use WildcardQueryBuilder as follows

WildcardQueryBuilder wildcardQuery = QueryBuilders.wildcardQuery(, "1*4.5");

It is not able to retrieve any document. Can any one suggest me how to
achieve the same.

Thank you in advance.

Best,
Ashutosh Bhattacharya
Stammstr. 39
50823 Köln, Deutschland

Mob : (0049) 0176 31242825
Email: ashutosh.bhattacharya.in@gmail.com


(slushi) #2

maybe your field is being analyzed into multiple terms? you can use the
analyzehttp://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.htmlendpoint to check.

On Monday, June 4, 2012 10:13:33 AM UTC-4, Ashutosh Bhattacharya wrote:

Hi All,

We are using Java API of elasticsearch(0.19.1) for our application. I want
to store a document field with value "1-d:3.4.5" and then want to search
for the document having the value of the field "starts with 1 and end with
4.5". I tried to use WildcardQueryBuilder as follows

WildcardQueryBuilder wildcardQuery = QueryBuilders.wildcardQuery(, "1*4.5");

It is not able to retrieve any document. Can any one suggest me how to
achieve the same.

Thank you in advance.

Best,
Ashutosh Bhattacharya
Stammstr. 39
50823 Köln, Deutschland

Mob : (0049) 0176 31242825
Email: ashutosh.bhattacharya.in@gmail.com


(system) #3