Wildcard search on analyzed field

Hi All,

We would like to enable wildcard search on analyzed field.

As per my level of understanding, if analyzed is true, then wildcard search
would not work.

Please suggest some ways to achieve above usecase.

Thanks,
Ankit Jain
iLabs

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Ankit,

you could use the query_string query, which allows leading wildcard
searches within analyzed fields.

However, if you would like to use wildcards anywhere, you would probably
have to change over the concerned field to a multi_field, and store both an
analyzed as well as a not_analyzed version of the data (If I am not
mistaken - I am still fairly new to this).
You would then be able to issue a wildcard query, for instance, on the
not_analyzed version of the data:
http://www.elasticsearch.org/guide/reference/query-dsl/wildcard-query/

  • chris

On Thursday, May 23, 2013 8:06:22 PM UTC+2, Ankit Jain wrote:

Hi All,

We would like to enable wildcard search on analyzed field.

As per my level of understanding, if analyzed is true, then wildcard
search would not work.

Please suggest some ways to achieve above usecase.

Thanks,
Ankit Jain
iLabs

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

to add to this, you can run wildcard queries on any field that is indexed
not just analyzed fields.

simon

On Friday, May 24, 2013 8:47:03 AM UTC+2, Chris Kinsalb wrote:

Hi Ankit,

you could use the query_string query, which allows leading wildcard
searches within analyzed fields.

However, if you would like to use wildcards anywhere, you would probably
have to change over the concerned field to a multi_field, and store both an
analyzed as well as a not_analyzed version of the data (If I am not
mistaken - I am still fairly new to this).
You would then be able to issue a wildcard query, for instance, on the
not_analyzed version of the data:
http://www.elasticsearch.org/guide/reference/query-dsl/wildcard-query/

  • chris

On Thursday, May 23, 2013 8:06:22 PM UTC+2, Ankit Jain wrote:

Hi All,

We would like to enable wildcard search on analyzed field.

As per my level of understanding, if analyzed is true, then wildcard
search would not work.

Please suggest some ways to achieve above usecase.

Thanks,
Ankit Jain
iLabs

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Ankit,

You should try to use the query_string with the option "analyze_wildcard"
set to true.

For more detail :
http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query/

I hope it can help you.

Regards

Benjamin

On Fri, May 24, 2013 at 10:27 AM, simonw
simon.willnauer@elasticsearch.comwrote:

to add to this, you can run wildcard queries on any field that is indexed
not just analyzed fields.

simon

On Friday, May 24, 2013 8:47:03 AM UTC+2, Chris Kinsalb wrote:

Hi Ankit,

you could use the query_string query, which allows leading wildcard
searches within analyzed fields.

However, if you would like to use wildcards anywhere, you would probably
have to change over the concerned field to a multi_field, and store both an
analyzed as well as a not_analyzed version of the data (If I am not
mistaken - I am still fairly new to this).
You would then be able to issue a wildcard query, for instance, on the
not_analyzed version of the data:
http://www.elasticsearch.org/guide/reference/query-dsl/
wildcard-query/http://www.elasticsearch.org/guide/reference/query-dsl/wildcard-query/

  • chris

On Thursday, May 23, 2013 8:06:22 PM UTC+2, Ankit Jain wrote:

Hi All,

We would like to enable wildcard search on analyzed field.

As per my level of understanding, if analyzed is true, then wildcard
search would not work.

Please suggest some ways to achieve above usecase.

Thanks,
Ankit Jain
iLabs

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

1 Like