JSON wildcard search

Hi,

Could anyone point me in the right direction on this one...

JSON request with something similar to this in the body:

{
"query" : {
"term" : { "user" : "kim*" }
}
}

as opposed to this similar query-string request:

http://elastichost/e/e/_search?q=user:kim*

(On a different data set) does not seem to produce the same result...
What am I missing with regards to the "*" wildcard?

--Albin

On Mon, Oct 25, 2010 at 4:12 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Is there a chance that it ends up opening and closing connections for each
index request? You might run out of file descriptors (sockets) that way.

On Mon, Oct 25, 2010 at 4:02 PM, Jakub jakub.wachol@gmail.com wrote:

Thx for answer.

I'm 100% sure it's not PHP memory problem.
PHP setting "memory_limit" is set to 128M in php.ini file.
Script that break with error "Couldnt connect to host
[123.123.123.123], Elasticsearch down?" use only 20.75 megabytes
So it's not the reason of problem.

Regards
Jakub

On 25 Paź, 12:26, Michiel Eghuizen michieleghui...@gmail.com wrote:

This could be a memory problem in PHP itself. So you could findout if
that's
the case. Because insert such many items in 1 array for example, will
also
need such amount of space of memory.

On Mon, Oct 25, 2010 at 12:18 PM, Jakub jakub.wac...@gmail.com wrote:

Hi,

I'm using latest elasticsearch release 0.12.0
I have problem with insert data to elasticsearch.
I'm using "elasticsearch" PHP client to insert data.

Insert data is done in loop.
PHP script insert 0 - 10000 entries and reload itself.
Next it insert entries from 10000 - 20000. And it reload and start
from 30000.
Script should works like this to the end. About 190000 entries.

Insert single entry works ok. Problem is that script stops every time
after insert 28233 entries.
I'm 100% sure it's not problem with inserted data of entry 28233
because starting from 10000 it will go thourgh entry 28233 without any
problem and will stop on entry 38233. So it always insert only 28233
entries.
PHP client return error.
Couldnt connect to host [123.123.123.123], Elasticsearch down?

(123.123.123.123 - is fake ip address)

This problem don't generate any log entry in log file.
Elasticsearch is not down after this problem happen.

Did anyone have same problem?
Can anyone help me to find what is the reason of this problem?

Thank You
Regards
Jakub

Hi,

contrary to query_string (the query type the q URL parameter maps to) the
term query is not analyzed, thus in your case it searches for "kim*" token
(note, this means it is not performing wildcard query).

http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/term_query/

http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/term_query/
Regards,
Lukas

On Mon, Oct 25, 2010 at 4:19 PM, Albin Stigo albin.stigo@gmail.com wrote:

Hi,

Could anyone point me in the right direction on this one...

JSON request with something similar to this in the body:

{
"query" : {
"term" : { "user" : "kim*" }
}
}

as opposed to this similar query-string request:

http://elastichost/e/e/_search?q=user:kim*

(On a different data set) does not seem to produce the same result...
What am I missing with regards to the "*" wildcard?

--Albin

On Mon, Oct 25, 2010 at 4:12 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Is there a chance that it ends up opening and closing connections for
each
index request? You might run out of file descriptors (sockets) that way.

On Mon, Oct 25, 2010 at 4:02 PM, Jakub jakub.wachol@gmail.com wrote:

Thx for answer.

I'm 100% sure it's not PHP memory problem.
PHP setting "memory_limit" is set to 128M in php.ini file.
Script that break with error "Couldnt connect to host
[123.123.123.123], Elasticsearch down?" use only 20.75 megabytes
So it's not the reason of problem.

Regards
Jakub

On 25 Paź, 12:26, Michiel Eghuizen michieleghui...@gmail.com wrote:

This could be a memory problem in PHP itself. So you could findout if
that's
the case. Because insert such many items in 1 array for example, will
also
need such amount of space of memory.

On Mon, Oct 25, 2010 at 12:18 PM, Jakub jakub.wac...@gmail.com
wrote:

Hi,

I'm using latest elasticsearch release 0.12.0
I have problem with insert data to elasticsearch.
I'm using "elasticsearch" PHP client to insert data.

Insert data is done in loop.
PHP script insert 0 - 10000 entries and reload itself.
Next it insert entries from 10000 - 20000. And it reload and start
from 30000.
Script should works like this to the end. About 190000 entries.

Insert single entry works ok. Problem is that script stops every
time
after insert 28233 entries.
I'm 100% sure it's not problem with inserted data of entry 28233
because starting from 10000 it will go thourgh entry 28233 without
any
problem and will stop on entry 38233. So it always insert only 28233
entries.
PHP client return error.
Couldnt connect to host [123.123.123.123], Elasticsearch down?

(123.123.123.123 - is fake ip address)

This problem don't generate any log entry in log file.
Elasticsearch is not down after this problem happen.

Did anyone have same problem?
Can anyone help me to find what is the reason of this problem?

Thank You
Regards
Jakub

You can use the wildcard query explicitly:
http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/wildcard_query/.
You can also use the field query which accepts a query string that supports
this format as well:
Query DSL | Elasticsearch Guide [8.11] | Elastic
.

-shay.banon

On Mon, Oct 25, 2010 at 8:19 PM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

Hi,

contrary to query_string (the query type the q URL parameter maps to) the
term query is not analyzed, thus in your case it searches for "kim*" token
(note, this means it is not performing wildcard query).

http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/term_query/

http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/term_query/
Regards,
Lukas

On Mon, Oct 25, 2010 at 4:19 PM, Albin Stigo albin.stigo@gmail.comwrote:

Hi,

Could anyone point me in the right direction on this one...

JSON request with something similar to this in the body:

{
"query" : {
"term" : { "user" : "kim*" }
}
}

as opposed to this similar query-string request:

http://elastichost/e/e/_search?q=user:kim*

(On a different data set) does not seem to produce the same result...
What am I missing with regards to the "*" wildcard?

--Albin

On Mon, Oct 25, 2010 at 4:12 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Is there a chance that it ends up opening and closing connections for
each
index request? You might run out of file descriptors (sockets) that way.

On Mon, Oct 25, 2010 at 4:02 PM, Jakub jakub.wachol@gmail.com wrote:

Thx for answer.

I'm 100% sure it's not PHP memory problem.
PHP setting "memory_limit" is set to 128M in php.ini file.
Script that break with error "Couldnt connect to host
[123.123.123.123], Elasticsearch down?" use only 20.75 megabytes
So it's not the reason of problem.

Regards
Jakub

On 25 Paź, 12:26, Michiel Eghuizen michieleghui...@gmail.com wrote:

This could be a memory problem in PHP itself. So you could findout if
that's
the case. Because insert such many items in 1 array for example, will
also
need such amount of space of memory.

On Mon, Oct 25, 2010 at 12:18 PM, Jakub jakub.wac...@gmail.com
wrote:

Hi,

I'm using latest elasticsearch release 0.12.0
I have problem with insert data to elasticsearch.
I'm using "elasticsearch" PHP client to insert data.

Insert data is done in loop.
PHP script insert 0 - 10000 entries and reload itself.
Next it insert entries from 10000 - 20000. And it reload and start
from 30000.
Script should works like this to the end. About 190000 entries.

Insert single entry works ok. Problem is that script stops every
time
after insert 28233 entries.
I'm 100% sure it's not problem with inserted data of entry 28233
because starting from 10000 it will go thourgh entry 28233 without
any
problem and will stop on entry 38233. So it always insert only
28233
entries.
PHP client return error.
Couldnt connect to host [123.123.123.123], Elasticsearch down?

(123.123.123.123 - is fake ip address)

This problem don't generate any log entry in log file.
Elasticsearch is not down after this problem happen.

Did anyone have same problem?
Can anyone help me to find what is the reason of this problem?

Thank You
Regards
Jakub