Error while retrieving an object field


(Mahendra M) #1

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

  "price" : {
    "type" : "object",
    "dynamic" : true,
    "enabled" : true,
    "store" : true,
    "include_in_all": false
  },

The documents will have different keys for this as follows. These may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for field
[price]]]

Is it possible to retrieve an object, in the JSON format as is ? Or am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Shay Banon) #2

Its not possible currently. There is a feature request to allow to return
parts of the _source json (as well as use it for highlighting).

-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows. These may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for field
[price]]]

Is it possible to retrieve an object, in the JSON format as is ? Or am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Mahendra M) #3

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot :slight_smile:

I have one doubt regarding the "script_fields" option. I guess it is
not available through the URI request method.

Also is it possible to obtain the object via the "fields" option ?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to allow to return
parts of the _source json (as well as use it for highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows. These may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for field
[price]]]

Is it possible to retrieve an object, in the JSON format as is ? Or am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Shay Banon) #4

No, only through the script fields. What are you missing, the option to
provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot :slight_smile:

I have one doubt regarding the "script_fields" option. I guess it is
not available through the URI request method.

Also is it possible to obtain the object via the "fields" option ?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to allow to return
parts of the _source json (as well as use it for highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows. These may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for field
[price]]]

Is it possible to retrieve an object, in the JSON format as is ? Or am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Mahendra M) #5

Hi,

Currently, my ElasticSearch setup is accessed through GET requests.
The returned fields are specified through the "fields" option in the
GET URI.

It would be good if I can specify the object field also in the GET
request and return the JSON format of the object field.

Alternately, I can make use of providing the script fields in the URI
of a GET request, if it is possible.

Regards,
Mahendra

http://twitter.com/mahendra

On Fri, Sep 3, 2010 at 2:02 PM, Shay Banon wrote:

No, only through the script fields. What are you missing, the option to provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot :slight_smile:

I have one doubt regarding the "script_fields" option. I guess it is
not available through the URI request method.

Also is it possible to obtain the object via the "fields" option ?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to allow to return
parts of the _source json (as well as use it for highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows. These may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for field
[price]]]

Is it possible to retrieve an object, in the JSON format as is ? Or am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Shay Banon) #6

Open an issue request, they can be added to the URI option as well. I think
that you are missing a lot of functionality by just using the search with
URI option. There shouldn't really be a problem providing a body in the
search request, no?

On Sun, Sep 5, 2010 at 9:27 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

Currently, my ElasticSearch setup is accessed through GET requests.
The returned fields are specified through the "fields" option in the
GET URI.

It would be good if I can specify the object field also in the GET
request and return the JSON format of the object field.

Alternately, I can make use of providing the script fields in the URI
of a GET request, if it is possible.

Regards,
Mahendra

http://twitter.com/mahendra

On Fri, Sep 3, 2010 at 2:02 PM, Shay Banon wrote:

No, only through the script fields. What are you missing, the option to
provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot :slight_smile:

I have one doubt regarding the "script_fields" option. I guess it is
not available through the URI request method.

Also is it possible to obtain the object via the "fields" option ?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to allow to
return

parts of the _source json (as well as use it for highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows. These may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for field
[price]]]

Is it possible to retrieve an object, in the JSON format as is ? Or
am

I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Mahendra M) #7

Hi,

I have opened an issue request for this (#357).

Yes, I know that I am missing on quite a lot of functionality by using
just the URI option, but this is used in clients which have very
limited resources. The more powerful clients use the query API.

I have exposed the URI to very tiny embedded devices which need to
query elastic search. The search URI is a simple option for them.

Another reason is, by using the "fields" API, the output of
Elasticsearch can be made very similar to the output of couchdb views.
So, clients accessing couchdb and elasticsearch can have the same
format for accessing data.

Regards,
Mahendra

http://twitter.com/mahendra

On Sun, Sep 5, 2010 at 12:57 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Open an issue request, they can be added to the URI option as well. I think
that you are missing a lot of functionality by just using the search with
URI option. There shouldn't really be a problem providing a body in the
search request, no?

On Sun, Sep 5, 2010 at 9:27 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

Currently, my ElasticSearch setup is accessed through GET requests.
The returned fields are specified through the "fields" option in the
GET URI.

It would be good if I can specify the object field also in the GET
request and return the JSON format of the object field.

Alternately, I can make use of providing the script fields in the URI
of a GET request, if it is possible.

Regards,
Mahendra

http://twitter.com/mahendra

On Fri, Sep 3, 2010 at 2:02 PM, Shay Banon wrote:

No, only through the script fields. What are you missing, the option to
provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot :slight_smile:

I have one doubt regarding the "script_fields" option. I guess it is
not available through the URI request method.

Also is it possible to obtain the object via the "fields" option ?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to allow to
return
parts of the _source json (as well as use it for highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows. These
may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for field
[price]]]

Is it possible to retrieve an object, in the JSON format as is ? Or
am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Shay Banon) #8

The problem with using fields is that I can't tell between ones that try and
fetch a stored field, compared to script fields that will result in getting
the source... .

-shay.banon

On Mon, Sep 6, 2010 at 7:48 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

I have opened an issue request for this (#357).

Yes, I know that I am missing on quite a lot of functionality by using
just the URI option, but this is used in clients which have very
limited resources. The more powerful clients use the query API.

I have exposed the URI to very tiny embedded devices which need to
query elastic search. The search URI is a simple option for them.

Another reason is, by using the "fields" API, the output of
Elasticsearch can be made very similar to the output of couchdb views.
So, clients accessing couchdb and elasticsearch can have the same
format for accessing data.

Regards,
Mahendra

http://twitter.com/mahendra

On Sun, Sep 5, 2010 at 12:57 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Open an issue request, they can be added to the URI option as well. I
think
that you are missing a lot of functionality by just using the search with
URI option. There shouldn't really be a problem providing a body in the
search request, no?

On Sun, Sep 5, 2010 at 9:27 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

Currently, my ElasticSearch setup is accessed through GET requests.
The returned fields are specified through the "fields" option in the
GET URI.

It would be good if I can specify the object field also in the GET
request and return the JSON format of the object field.

Alternately, I can make use of providing the script fields in the URI
of a GET request, if it is possible.

Regards,
Mahendra

http://twitter.com/mahendra

On Fri, Sep 3, 2010 at 2:02 PM, Shay Banon wrote:

No, only through the script fields. What are you missing, the option
to

provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot :slight_smile:

I have one doubt regarding the "script_fields" option. I guess it is
not available through the URI request method.

Also is it possible to obtain the object via the "fields" option ?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to allow to
return
parts of the _source json (as well as use it for highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M <mahendra.m@gmail.com

wrote:

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows. These
may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field
as-is

by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for
field

[price]]]

Is it possible to retrieve an object, in the JSON format as is ?
Or

am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just
the

"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Mahendra M) #9

Hmmm, i understand the problem.

In that case, would it be possible to use script fields in the search URI ?

Regards,
Mahendra

http://twitter.com/mahendra

On Mon, Sep 6, 2010 at 12:31 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

The problem with using fields is that I can't tell between ones that try and
fetch a stored field, compared to script fields that will result in getting
the source... .
-shay.banon

On Mon, Sep 6, 2010 at 7:48 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

I have opened an issue request for this (#357).

Yes, I know that I am missing on quite a lot of functionality by using
just the URI option, but this is used in clients which have very
limited resources. The more powerful clients use the query API.

I have exposed the URI to very tiny embedded devices which need to
query elastic search. The search URI is a simple option for them.

Another reason is, by using the "fields" API, the output of
Elasticsearch can be made very similar to the output of couchdb views.
So, clients accessing couchdb and elasticsearch can have the same
format for accessing data.

Regards,
Mahendra

http://twitter.com/mahendra

On Sun, Sep 5, 2010 at 12:57 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Open an issue request, they can be added to the URI option as well. I
think
that you are missing a lot of functionality by just using the search
with
URI option. There shouldn't really be a problem providing a body in the
search request, no?

On Sun, Sep 5, 2010 at 9:27 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

Currently, my ElasticSearch setup is accessed through GET requests.
The returned fields are specified through the "fields" option in the
GET URI.

It would be good if I can specify the object field also in the GET
request and return the JSON format of the object field.

Alternately, I can make use of providing the script fields in the URI
of a GET request, if it is possible.

Regards,
Mahendra

http://twitter.com/mahendra

On Fri, Sep 3, 2010 at 2:02 PM, Shay Banon wrote:

No, only through the script fields. What are you missing, the option
to
provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot :slight_smile:

I have one doubt regarding the "script_fields" option. I guess it is
not available through the URI request method.

Also is it possible to obtain the object via the "fields" option ?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to allow to
return
parts of the _source json (as well as use it for highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M
mahendra.m@gmail.com
wrote:

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows. These
may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field
as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for
field
[price]]]

Is it possible to retrieve an object, in the JSON format as is ?
Or
am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just
the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Shay Banon) #10

Yea, sure, I will come up with a schema for this.

On Mon, Sep 6, 2010 at 10:13 AM, Mahendra M mahendra.m@gmail.com wrote:

Hmmm, i understand the problem.

In that case, would it be possible to use script fields in the search URI ?

Regards,
Mahendra

http://twitter.com/mahendra

On Mon, Sep 6, 2010 at 12:31 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

The problem with using fields is that I can't tell between ones that try
and
fetch a stored field, compared to script fields that will result in
getting
the source... .
-shay.banon

On Mon, Sep 6, 2010 at 7:48 AM, Mahendra M mahendra.m@gmail.com wrote:

Hi,

I have opened an issue request for this (#357).

Yes, I know that I am missing on quite a lot of functionality by using
just the URI option, but this is used in clients which have very
limited resources. The more powerful clients use the query API.

I have exposed the URI to very tiny embedded devices which need to
query elastic search. The search URI is a simple option for them.

Another reason is, by using the "fields" API, the output of
Elasticsearch can be made very similar to the output of couchdb views.
So, clients accessing couchdb and elasticsearch can have the same
format for accessing data.

Regards,
Mahendra

http://twitter.com/mahendra

On Sun, Sep 5, 2010 at 12:57 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Open an issue request, they can be added to the URI option as well. I
think
that you are missing a lot of functionality by just using the search
with
URI option. There shouldn't really be a problem providing a body in
the

search request, no?

On Sun, Sep 5, 2010 at 9:27 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

Currently, my ElasticSearch setup is accessed through GET requests.
The returned fields are specified through the "fields" option in the
GET URI.

It would be good if I can specify the object field also in the GET
request and return the JSON format of the object field.

Alternately, I can make use of providing the script fields in the URI
of a GET request, if it is possible.

Regards,
Mahendra

http://twitter.com/mahendra

On Fri, Sep 3, 2010 at 2:02 PM, Shay Banon wrote:

No, only through the script fields. What are you missing, the
option

to
provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot
:slight_smile:

I have one doubt regarding the "script_fields" option. I guess it
is

not available through the URI request method.

Also is it possible to obtain the object via the "fields" option ?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to allow
to

return
parts of the _source json (as well as use it for highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M
mahendra.m@gmail.com
wrote:

Hi,

In the documents that I index, I have a field of 'object' type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows.
These

may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field
as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for
field
[price]]]

Is it possible to retrieve an object, in the JSON format as is
?

Or
am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting just
the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Shay Banon) #11

ok, was wrong about not being able to identify it, it actually can be
identified quite simply. Revised your issue you opened to this:
http://github.com/elasticsearch/elasticsearch/issues/issue/357. Have
something already running locally, will push later today.

On Mon, Sep 6, 2010 at 10:15 AM, Shay Banon shay.banon@elasticsearch.comwrote:

Yea, sure, I will come up with a schema for this.

On Mon, Sep 6, 2010 at 10:13 AM, Mahendra M mahendra.m@gmail.com wrote:

Hmmm, i understand the problem.

In that case, would it be possible to use script fields in the search URI
?

Regards,
Mahendra

http://twitter.com/mahendra

On Mon, Sep 6, 2010 at 12:31 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

The problem with using fields is that I can't tell between ones that try
and
fetch a stored field, compared to script fields that will result in
getting
the source... .
-shay.banon

On Mon, Sep 6, 2010 at 7:48 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

I have opened an issue request for this (#357).

Yes, I know that I am missing on quite a lot of functionality by using
just the URI option, but this is used in clients which have very
limited resources. The more powerful clients use the query API.

I have exposed the URI to very tiny embedded devices which need to
query elastic search. The search URI is a simple option for them.

Another reason is, by using the "fields" API, the output of
Elasticsearch can be made very similar to the output of couchdb views.
So, clients accessing couchdb and elasticsearch can have the same
format for accessing data.

Regards,
Mahendra

http://twitter.com/mahendra

On Sun, Sep 5, 2010 at 12:57 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Open an issue request, they can be added to the URI option as well. I
think
that you are missing a lot of functionality by just using the search
with
URI option. There shouldn't really be a problem providing a body in
the

search request, no?

On Sun, Sep 5, 2010 at 9:27 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

Currently, my ElasticSearch setup is accessed through GET requests.
The returned fields are specified through the "fields" option in the
GET URI.

It would be good if I can specify the object field also in the GET
request and return the JSON format of the object field.

Alternately, I can make use of providing the script fields in the
URI

of a GET request, if it is possible.

Regards,
Mahendra

http://twitter.com/mahendra

On Fri, Sep 3, 2010 at 2:02 PM, Shay Banon wrote:

No, only through the script fields. What are you missing, the
option

to
provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M <mahendra.m@gmail.com

wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot
:slight_smile:

I have one doubt regarding the "script_fields" option. I guess it
is

not available through the URI request method.

Also is it possible to obtain the object via the "fields" option
?

By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to allow
to

return
parts of the _source json (as well as use it for highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M
mahendra.m@gmail.com
wrote:

Hi,

In the documents that I index, I have a field of 'object'
type.

Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows.
These

may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price field
as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping for
field
[price]]]

Is it possible to retrieve an object, in the JSON format as is
?

Or
am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting
just

the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra


(Mahendra M) #12

Oh cool.

Will test it out thoroughly after you push it :slight_smile:

Thanks ..

On Mon, Sep 6, 2010 at 2:08 PM, Shay Banon shay.banon@elasticsearch.com wrote:

ok, was wrong about not being able to identify it, it actually can be
identified quite simply. Revised your issue you opened to
this: http://github.com/elasticsearch/elasticsearch/issues/issue/357. Have
something already running locally, will push later today.

On Mon, Sep 6, 2010 at 10:15 AM, Shay Banon shay.banon@elasticsearch.com
wrote:

Yea, sure, I will come up with a schema for this.

On Mon, Sep 6, 2010 at 10:13 AM, Mahendra M mahendra.m@gmail.com wrote:

Hmmm, i understand the problem.

In that case, would it be possible to use script fields in the search URI
?

Regards,
Mahendra

http://twitter.com/mahendra

On Mon, Sep 6, 2010 at 12:31 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

The problem with using fields is that I can't tell between ones that
try and
fetch a stored field, compared to script fields that will result in
getting
the source... .
-shay.banon

On Mon, Sep 6, 2010 at 7:48 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

I have opened an issue request for this (#357).

Yes, I know that I am missing on quite a lot of functionality by using
just the URI option, but this is used in clients which have very
limited resources. The more powerful clients use the query API.

I have exposed the URI to very tiny embedded devices which need to
query elastic search. The search URI is a simple option for them.

Another reason is, by using the "fields" API, the output of
Elasticsearch can be made very similar to the output of couchdb views.
So, clients accessing couchdb and elasticsearch can have the same
format for accessing data.

Regards,
Mahendra

http://twitter.com/mahendra

On Sun, Sep 5, 2010 at 12:57 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Open an issue request, they can be added to the URI option as well.
I
think
that you are missing a lot of functionality by just using the search
with
URI option. There shouldn't really be a problem providing a body in
the
search request, no?

On Sun, Sep 5, 2010 at 9:27 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

Currently, my ElasticSearch setup is accessed through GET requests.
The returned fields are specified through the "fields" option in
the
GET URI.

It would be good if I can specify the object field also in the GET
request and return the JSON format of the object field.

Alternately, I can make use of providing the script fields in the
URI
of a GET request, if it is possible.

Regards,
Mahendra

http://twitter.com/mahendra

On Fri, Sep 3, 2010 at 2:02 PM, Shay Banon wrote:

No, only through the script fields. What are you missing, the
option
to
provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M
mahendra.m@gmail.com
wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot
:slight_smile:

I have one doubt regarding the "script_fields" option. I guess
it is
not available through the URI request method.

Also is it possible to obtain the object via the "fields" option
?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to
allow to
return
parts of the _source json (as well as use it for
highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M
mahendra.m@gmail.com
wrote:

Hi,

In the documents that I index, I have a field of 'object'
type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows.
These
may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price
field
as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping
for
field
[price]]]

Is it possible to retrieve an object, in the JSON format as
is ?
Or
am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting
just
the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra

--
Mahendra

http://twitter.com/mahendra


(Mahendra M) #13

Hi,

I checked out the latest version and checked out this feature.

Providing fields=x,y,_source.field_name works great now.

Thanks a lot Shay :slight_smile:

Regards,
Mahendra

http://twitter.com/mahendra

On Mon, Sep 6, 2010 at 2:52 PM, Mahendra M mahendra.m@gmail.com wrote:

Oh cool.

Will test it out thoroughly after you push it :slight_smile:

Thanks ..

On Mon, Sep 6, 2010 at 2:08 PM, Shay Banon shay.banon@elasticsearch.com wrote:

ok, was wrong about not being able to identify it, it actually can be
identified quite simply. Revised your issue you opened to
this: http://github.com/elasticsearch/elasticsearch/issues/issue/357. Have
something already running locally, will push later today.

On Mon, Sep 6, 2010 at 10:15 AM, Shay Banon shay.banon@elasticsearch.com
wrote:

Yea, sure, I will come up with a schema for this.

On Mon, Sep 6, 2010 at 10:13 AM, Mahendra M mahendra.m@gmail.com wrote:

Hmmm, i understand the problem.

In that case, would it be possible to use script fields in the search URI
?

Regards,
Mahendra

http://twitter.com/mahendra

On Mon, Sep 6, 2010 at 12:31 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

The problem with using fields is that I can't tell between ones that
try and
fetch a stored field, compared to script fields that will result in
getting
the source... .
-shay.banon

On Mon, Sep 6, 2010 at 7:48 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

I have opened an issue request for this (#357).

Yes, I know that I am missing on quite a lot of functionality by using
just the URI option, but this is used in clients which have very
limited resources. The more powerful clients use the query API.

I have exposed the URI to very tiny embedded devices which need to
query elastic search. The search URI is a simple option for them.

Another reason is, by using the "fields" API, the output of
Elasticsearch can be made very similar to the output of couchdb views.
So, clients accessing couchdb and elasticsearch can have the same
format for accessing data.

Regards,
Mahendra

http://twitter.com/mahendra

On Sun, Sep 5, 2010 at 12:57 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Open an issue request, they can be added to the URI option as well.
I
think
that you are missing a lot of functionality by just using the search
with
URI option. There shouldn't really be a problem providing a body in
the
search request, no?

On Sun, Sep 5, 2010 at 9:27 AM, Mahendra M mahendra.m@gmail.com
wrote:

Hi,

Currently, my ElasticSearch setup is accessed through GET requests.
The returned fields are specified through the "fields" option in
the
GET URI.

It would be good if I can specify the object field also in the GET
request and return the JSON format of the object field.

Alternately, I can make use of providing the script fields in the
URI
of a GET request, if it is possible.

Regards,
Mahendra

http://twitter.com/mahendra

On Fri, Sep 3, 2010 at 2:02 PM, Shay Banon wrote:

No, only through the script fields. What are you missing, the
option
to
provide script fields in the URI of a GET request.

On Fri, Sep 3, 2010 at 10:28 AM, Mahendra M
mahendra.m@gmail.com
wrote:

Hi,

I guess the latest commit (349) adds this feature. Thanks a lot
:slight_smile:

I have one doubt regarding the "script_fields" option. I guess
it is
not available through the URI request method.

Also is it possible to obtain the object via the "fields" option
?
By specifying

fields=...,...,doc.price OR
fields=...,...,_source.price

Regards,
Mahendra

http://twitter.com/mahendra

On Tue, Aug 31, 2010 at 1:48 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Its not possible currently. There is a feature request to
allow to
return
parts of the _source json (as well as use it for
highlighting).
-shay.bnaon

On Tue, Aug 31, 2010 at 10:22 AM, Mahendra M
mahendra.m@gmail.com
wrote:

Hi,

In the documents that I index, I have a field of 'object'
type.
Mapped as follows.

 "price" : {
   "type" : "object",
   "dynamic" : true,
   "enabled" : true,
   "store" : true,
   "include_in_all": false
 },

The documents will have different keys for this as follows.
These
may
be fixed or varying.
'price' : {
'us' : 1.0,
'uk' : 2.0
}

My requirement, is that while querying, I need the price
field
as-is
by specifying
the "fields" option. In this example, I give -
fields=price

However, I get the error:
reason: "FetchPhaseExecutionException[[index_name][0]:
query[_all:a],from[0],size[10]: Fetch Failed [No mapping
for
field
[price]]]

Is it possible to retrieve an object, in the JSON format as
is ?
Or
am
I doing it incorrectly ?

I do not want to retrieve the entire '_source' for getting
just
the
"price" fields within it.

Regards,
Mahendra

http://twitter.com/mahendra

--
Mahendra

http://twitter.com/mahendra


(system) #14