Exact Match Query

Hi guys.

Is there a way to query for exact match over a string array field
(usernames in my case).

A terms filter on 'John' matches usernames such as 'John Doe'

Thanks!

-stan

Have you tried to index the string array field as keyword and use a terms
filter?

-- Tanguy

Le jeudi 31 mai 2012 10:00:35 UTC+2, Stanislas Polu a écrit :

Hi guys.

Is there a way to query for exact match over a string array field
(usernames in my case).

A terms filter on 'John' matches usernames such as 'John Doe'

Thanks!

-stan

Nope. I'll try that!

Will this preserve the structure of the results I get?

Best,

-stan

--
Stanislas Polu
Mo: +33 6 83 71 90 04 | Tw: @spolu | http://teleportd.com | Realtime Photo
Search

On Thu, May 31, 2012 at 1:10 PM, Tanguy tlrx.dev@gmail.com wrote:

Have you tried to index the string array field as keyword and use a terms
filter?

Elasticsearch Platform — Find real-time answers at scale | Elastic

-- Tanguy

Le jeudi 31 mai 2012 10:00:35 UTC+2, Stanislas Polu a écrit :

Hi guys.

Is there a way to query for exact match over a string array field
(usernames in my case).

A terms filter on 'John' matches usernames such as 'John Doe'

Thanks!

-stan

It will, you can also just set the index mapping option on the username
field to not_analyzed.

On Thu, May 31, 2012 at 6:36 PM, Stanislas Polu polu.stanislas@gmail.comwrote:

Nope. I'll try that!

Will this preserve the structure of the results I get?

Best,

-stan

--
Stanislas Polu
Mo: +33 6 83 71 90 04 | Tw: @spolu | http://teleportd.com | Realtime
Photo Search

On Thu, May 31, 2012 at 1:10 PM, Tanguy tlrx.dev@gmail.com wrote:

Have you tried to index the string array field as keyword and use a terms
filter?

Elasticsearch Platform — Find real-time answers at scale | Elastic

-- Tanguy

Le jeudi 31 mai 2012 10:00:35 UTC+2, Stanislas Polu a écrit :

Hi guys.

Is there a way to query for exact match over a string array field
(usernames in my case).

A terms filter on 'John' matches usernames such as 'John Doe'

Thanks!

-stan