Exact matching


(BeckerIV) #1

I am trying to build a query to match a string (username) exactly.

I thought term would work for me.

Any help would be well..helpful
Thanks!
Becker


(Shay Banon) #2

Are you sure the username is not analyzed? Use get mapping to verify it is:
http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html
.

On Mon, Aug 8, 2011 at 8:14 AM, BeckerIV sbeckeriv@gmail.com wrote:

I am trying to build a query to match a string (username) exactly.

https://gist.github.com/1131225

I thought term would work for me.

Any help would be well..helpful
Thanks!
Becker


(BeckerIV) #3

Thanks. It still gives me many matt's.

I found I was running 5 elasticsearches. I stopped them all. Deleted the
data directory and re-added the data. This was an error in how I was
setup and running elasticsearch. I updated the gist
https://gist.github.com/1131225 with the mapping call. I am still
seeing the same results. I am sure I am now running only one elasticsearch.

Thanks again for the help.
Becker

On Mon, Aug 8, 2011 at 12:35 AM, Shay Banon kimchy@gmail.com wrote:

Are you sure the username is not analyzed? Use get mapping to verify it
is: http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html.

On Mon, Aug 8, 2011 at 8:14 AM, BeckerIV sbeckeriv@gmail.com wrote:

I am trying to build a query to match a string (username) exactly.

https://gist.github.com/1131225

I thought term would work for me.

Any help would be well..helpful
Thanks!
Becker


(Shay Banon) #4

You have two types? document and person? Make sure username is not analyzed
on both of them.

On Mon, Aug 8, 2011 at 5:59 PM, SbeckerIV sbeckeriv@gmail.com wrote:

Thanks. It still gives me many matt's.

I found I was running 5 elasticsearches. I stopped them all. Deleted the
data directory and re-added the data. This was an error in how I was
setup and running elasticsearch. I updated the gist
https://gist.github.com/1131225 with the mapping call. I am still
seeing the same results. I am sure I am now running only one elasticsearch.

Thanks again for the help.
Becker

On Mon, Aug 8, 2011 at 12:35 AM, Shay Banon kimchy@gmail.com wrote:

Are you sure the username is not analyzed? Use get mapping to verify it
is:
http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html
.

On Mon, Aug 8, 2011 at 8:14 AM, BeckerIV sbeckeriv@gmail.com wrote:

I am trying to build a query to match a string (username) exactly.

https://gist.github.com/1131225

I thought term would work for me.

Any help would be well..helpful
Thanks!
Becker


(BeckerIV) #5

I dont mean to have two types. I am using the ruby Tire lib. I will
work on recreating my types via curl and see if that helps things. I
changed username to person.username and I also tried /g/person/_search
both of those came up empty. The way I index the data is incorrect.
that would explain why there is a second type!

Thanks for helping me debug this. Im pretty sure its my bulk index
code. I will let you know when I figure it out.
Becker

On Mon, Aug 8, 2011 at 8:12 AM, Shay Banon kimchy@gmail.com wrote:

You have two types? document and person? Make sure username is not analyzed
on both of them.

On Mon, Aug 8, 2011 at 5:59 PM, SbeckerIV sbeckeriv@gmail.com wrote:

Thanks. It still gives me many matt's.

I found I was running 5 elasticsearches. I stopped them all. Deleted the
data directory and re-added the data. This was an error in how I was
setup and running elasticsearch. I updated the gist
https://gist.github.com/1131225 with the mapping call. I am still
seeing the same results. I am sure I am now running only one
elasticsearch.

Thanks again for the help.
Becker

On Mon, Aug 8, 2011 at 12:35 AM, Shay Banon kimchy@gmail.com wrote:

Are you sure the username is not analyzed? Use get mapping to verify it

is: http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html.

On Mon, Aug 8, 2011 at 8:14 AM, BeckerIV sbeckeriv@gmail.com wrote:

I am trying to build a query to match a string (username) exactly.

https://gist.github.com/1131225

I thought term would work for me.

Any help would be well..helpful
Thanks!
Becker


(Shay Banon) #6

For some reason, you end up indexing two types, I would check the indexing
code and see why it happens... .

On Mon, Aug 8, 2011 at 7:11 PM, SbeckerIV sbeckeriv@gmail.com wrote:

I dont mean to have two types. I am using the ruby Tire lib. I will
work on recreating my types via curl and see if that helps things. I
changed username to person.username and I also tried /g/person/_search
both of those came up empty. The way I index the data is incorrect.
that would explain why there is a second type!

Thanks for helping me debug this. Im pretty sure its my bulk index
code. I will let you know when I figure it out.
Becker

On Mon, Aug 8, 2011 at 8:12 AM, Shay Banon kimchy@gmail.com wrote:

You have two types? document and person? Make sure username is not
analyzed
on both of them.

On Mon, Aug 8, 2011 at 5:59 PM, SbeckerIV sbeckeriv@gmail.com wrote:

Thanks. It still gives me many matt's.

I found I was running 5 elasticsearches. I stopped them all. Deleted the
data directory and re-added the data. This was an error in how I was
setup and running elasticsearch. I updated the gist
https://gist.github.com/1131225 with the mapping call. I am still
seeing the same results. I am sure I am now running only one
elasticsearch.

Thanks again for the help.
Becker

On Mon, Aug 8, 2011 at 12:35 AM, Shay Banon kimchy@gmail.com wrote:

Are you sure the username is not analyzed? Use get mapping to verify
it

is:
http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html
.

On Mon, Aug 8, 2011 at 8:14 AM, BeckerIV sbeckeriv@gmail.com wrote:

I am trying to build a query to match a string (username) exactly.

https://gist.github.com/1131225

I thought term would work for me.

Any help would be well..helpful
Thanks!
Becker


(Javier Muniz) #7

I saw this same behavior when using Tire this weekend. Are you indexing the item twice? I found that Tire's import method was stripping type from the documents, so when I reused the object to store an update, my type was set to document. Kindof an odd corner case, but it's definitely odd that Tire's import appears to modify the array of documents passed into it.

-javier


From: elasticsearch@googlegroups.com [elasticsearch@googlegroups.com] on behalf of Shay Banon [kimchy@gmail.com]
Sent: Monday, August 08, 2011 9:31 AM
To: elasticsearch@googlegroups.com
Subject: Re: Exact matching

For some reason, you end up indexing two types, I would check the indexing code and see why it happens... .

On Mon, Aug 8, 2011 at 7:11 PM, SbeckerIV <sbeckeriv@gmail.commailto:sbeckeriv@gmail.com> wrote:
I dont mean to have two types. I am using the ruby Tire lib. I will
work on recreating my types via curl and see if that helps things. I
changed username to person.username and I also tried /g/person/_search
both of those came up empty. The way I index the data is incorrect.
that would explain why there is a second type!

Thanks for helping me debug this. Im pretty sure its my bulk index
code. I will let you know when I figure it out.
Becker

On Mon, Aug 8, 2011 at 8:12 AM, Shay Banon <kimchy@gmail.commailto:kimchy@gmail.com> wrote:

You have two types? document and person? Make sure username is not analyzed
on both of them.

On Mon, Aug 8, 2011 at 5:59 PM, SbeckerIV <sbeckeriv@gmail.commailto:sbeckeriv@gmail.com> wrote:

Thanks. It still gives me many matt's.

I found I was running 5 elasticsearches. I stopped them all. Deleted the
data directory and re-added the data. This was an error in how I was
setup and running elasticsearch. I updated the gist
https://gist.github.com/1131225 with the mapping call. I am still
seeing the same results. I am sure I am now running only one
elasticsearch.

Thanks again for the help.
Becker

On Mon, Aug 8, 2011 at 12:35 AM, Shay Banon <kimchy@gmail.commailto:kimchy@gmail.com> wrote:

Are you sure the username is not analyzed? Use get mapping to verify it

is: http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html.

On Mon, Aug 8, 2011 at 8:14 AM, BeckerIV <sbeckeriv@gmail.commailto:sbeckeriv@gmail.com> wrote:

I am trying to build a query to match a string (username) exactly.

https://gist.github.com/1131225

I thought term would work for me.

Any help would be well..helpful
Thanks!
Becker


(BeckerIV) #8

After reading the tire gem I had locally I needed to use "type" or
:type as a key in my data hashes. The newer version has more logic and
includes :_type or "_type" which I was using.

https://github.com/karmi/tire/blob/master/lib/tire/index.rb line
270ish for more.

Thanks everyone for the help! I am now only getting one matt back.
Also I suspect the geo features should work now.
Thanks so much!
Becker

On Mon, Aug 8, 2011 at 9:40 AM, Javier Muniz javier@granicus.com wrote:

I saw this same behavior when using Tire this weekend. Are you indexing the
item twice? I found that Tire's import method was stripping type from the
documents, so when I reused the object to store an update, my type was set
to document. Kindof an odd corner case, but it's definitely odd that Tire's
import appears to modify the array of documents passed into it.

-javier


From: elasticsearch@googlegroups.com [elasticsearch@googlegroups.com] on
behalf of Shay Banon [kimchy@gmail.com]
Sent: Monday, August 08, 2011 9:31 AM
To: elasticsearch@googlegroups.com
Subject: Re: Exact matching

For some reason, you end up indexing two types, I would check the indexing
code and see why it happens... .

On Mon, Aug 8, 2011 at 7:11 PM, SbeckerIV sbeckeriv@gmail.com wrote:

I dont mean to have two types. I am using the ruby Tire lib. I will
work on recreating my types via curl and see if that helps things. I
changed username to person.username and I also tried /g/person/_search
both of those came up empty. The way I index the data is incorrect.
that would explain why there is a second type!

Thanks for helping me debug this. Im pretty sure its my bulk index
code. I will let you know when I figure it out.
Becker

On Mon, Aug 8, 2011 at 8:12 AM, Shay Banon kimchy@gmail.com wrote:

You have two types? document and person? Make sure username is not
analyzed
on both of them.

On Mon, Aug 8, 2011 at 5:59 PM, SbeckerIV sbeckeriv@gmail.com wrote:

Thanks. It still gives me many matt's.

I found I was running 5 elasticsearches. I stopped them all. Deleted
the
data directory and re-added the data. This was an error in how I was
setup and running elasticsearch. I updated the gist
https://gist.github.com/1131225 with the mapping call. I am still
seeing the same results. I am sure I am now running only one
elasticsearch.

Thanks again for the help.
Becker

On Mon, Aug 8, 2011 at 12:35 AM, Shay Banon kimchy@gmail.com wrote:

Are you sure the username is not analyzed? Use get mapping to verify
it

is: http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html.

On Mon, Aug 8, 2011 at 8:14 AM, BeckerIV sbeckeriv@gmail.com wrote:

I am trying to build a query to match a string (username) exactly.

https://gist.github.com/1131225

I thought term would work for me.

Any help would be well..helpful
Thanks!
Becker


(Karel Minarik) #9

Hi,

a) why not use the curl-based output from Tire's logger, implemented
exactly for a situation like this, for the gist? (see readme)

b) it's fairly clear you should set the type property in the
http://karmi.github.com/tire docs...

@javier: could you extract the problem you had with stripping the type
property from the Hash and send an issue for that? The reasoning
behind is, of course, that storing the type is completely unnecessary,
because such information is already contained in the ES document
type...

Karel

On 9 srp, 06:13, SbeckerIV sbecke...@gmail.com wrote:

After reading the tire gem I had locally I needed to use "type" or
:type as a key in my data hashes. The newer version has more logic and
includes :_type or "_type" which I was using.

https://github.com/karmi/tire/blob/master/lib/tire/index.rbline
270ish for more.

Thanks everyone for the help! I am now only getting one matt back.
Also I suspect the geo features should work now.
Thanks so much!
Becker

On Mon, Aug 8, 2011 at 9:40 AM, Javier Muniz jav...@granicus.com wrote:

I saw this same behavior when using Tire this weekend. Are you indexing the
item twice? I found that Tire's import method was stripping type from the
documents, so when I reused the object to store an update, my type was set
to document. Kindof an odd corner case, but it's definitely odd that Tire's
import appears to modify the array of documents passed into it.

-javier


From: elasticsearch@googlegroups.com [elasticsearch@googlegroups.com] on
behalf of Shay Banon [kim...@gmail.com]
Sent: Monday, August 08, 2011 9:31 AM
To: elasticsearch@googlegroups.com
Subject: Re: Exact matching

For some reason, you end up indexing two types, I would check the indexing
code and see why it happens... .

On Mon, Aug 8, 2011 at 7:11 PM, SbeckerIV sbecke...@gmail.com wrote:

I dont mean to have two types. I am using the ruby Tire lib. I will
work on recreating my types via curl and see if that helps things. I
changed username to person.username and I also tried /g/person/_search
both of those came up empty. The way I index the data is incorrect.
that would explain why there is a second type!

Thanks for helping me debug this. Im pretty sure its my bulk index
code. I will let you know when I figure it out.
Becker

On Mon, Aug 8, 2011 at 8:12 AM, Shay Banon kim...@gmail.com wrote:

You have two types? document and person? Make sure username is not
analyzed
on both of them.

On Mon, Aug 8, 2011 at 5:59 PM, SbeckerIV sbecke...@gmail.com wrote:

Thanks. It still gives me many matt's.

I found I was running 5 elasticsearches. I stopped them all. Deleted
the
data directory and re-added the data. This was an error in how I was
setup and running elasticsearch. I updated the gist
https://gist.github.com/1131225with the mapping call. I am still
seeing the same results. I am sure I am now running only one
elasticsearch.

Thanks again for the help.
Becker

On Mon, Aug 8, 2011 at 12:35 AM, Shay Banon kim...@gmail.com wrote:

Are you sure the username is not analyzed? Use get mapping to verify
it

is: http://www.elasticsearch.org/guide/reference/api/admin-indices-get-ma....

On Mon, Aug 8, 2011 at 8:14 AM, BeckerIV sbecke...@gmail.com wrote:

I am trying to build a query to match a string (username) exactly.

https://gist.github.com/1131225

I thought term would work for me.

Any help would be well..helpful
Thanks!
Becker


(system) #10