Re: ES 1.4.4 with Marvel latest throws exception in Chrome

2015-02-25 Thread Jay Hilden
Boaz, here is the output from fiddler.



On Wednesday, February 25, 2015 at 1:33:50 AM UTC-6, Boaz Leskes wrote:
>
> Hi Jay,
>
> There is a setting to increase that limit, but I want to understand what's 
> happening as it is unexpected. Can you open up the developer tools in 
> Chrome and check the headers of the failed request? I wonder what it is 
> that is so long.
>
> Cheers,
> Boaz, I found the culprit, I had cookies with the domain of localhost that 
> must have been longer than 8192 because once I cleared those it worked fine.
>

Out of curiosity, why is there a restriction on header at 8192? 

>
> On Tuesday, February 24, 2015 at 11:16:33 PM UTC+1, Jay Hilden wrote:
>>
>> I am on a Windows 8 PC and I downloaded ES 1.4.4, installed Marvel's 
>> latest version, and started ES.  ES starts up just fine but when I tried to 
>> view marvel I get an exception within ES:
>>
>> [2015-02-24 16:10:14,462][WARN ][http.netty   ] [Kid Nova] 
>> Caught exception while handling client http traffic, closing connection 
>> [id: 0xc3000144, /0:0:0:0:0:0:0:1:51607 => /0:0:0:0:0:0:0:1:9200]
>> org.elasticsearch.common.netty.handler.codec.frame.TooLongFrameException: 
>> HTTP header is larger than 8192 bytes.
>>
>> The only thing that I changed was the cluster name in the .yml file, 
>> nothing else was touched.
>>
>> This exception happens in Chrome, in FF Developer Edition it runs just 
>> fine.  
>>
>> What's up with that?
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/ae47082d-3a3f-4bc7-866d-39b0fa5914aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ES 1.4.4 with Marvel latest throws exception in Chrome

2015-02-25 Thread Jay Hilden

>
> Boaz, I found the culprit, I had cookies with the domain of localhost that 
> must have been longer than 8192 because once I cleared those it worked fine.
>

Out of curiosity, why is there a restriction on header at 8192? 

On Wednesday, February 25, 2015 at 1:33:50 AM UTC-6, Boaz Leskes wrote:
>
> Hi Jay,
>
> There is a setting to increase that limit, but I want to understand what's 
> happening as it is unexpected. Can you open up the developer tools in 
> Chrome and check the headers of the failed request? I wonder what it is 
> that is so long.
>
> Cheers,
> Boaz
>
> On Tuesday, February 24, 2015 at 11:16:33 PM UTC+1, Jay Hilden wrote:
>>
>> I am on a Windows 8 PC and I downloaded ES 1.4.4, installed Marvel's 
>> latest version, and started ES.  ES starts up just fine but when I tried to 
>> view marvel I get an exception within ES:
>>
>> [2015-02-24 16:10:14,462][WARN ][http.netty   ] [Kid Nova] 
>> Caught exception while handling client http traffic, closing connection 
>> [id: 0xc3000144, /0:0:0:0:0:0:0:1:51607 => /0:0:0:0:0:0:0:1:9200]
>> org.elasticsearch.common.netty.handler.codec.frame.TooLongFrameException: 
>> HTTP header is larger than 8192 bytes.
>>
>> The only thing that I changed was the cluster name in the .yml file, 
>> nothing else was touched.
>>
>> This exception happens in Chrome, in FF Developer Edition it runs just 
>> fine.  
>>
>> What's up with that?
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/807b6194-3b82-40ab-b2b4-28bbd1004809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ES 1.4.4 with Marvel latest throws exception in Chrome

2015-02-24 Thread Jay Hilden
I am on a Windows 8 PC and I downloaded ES 1.4.4, installed Marvel's latest 
version, and started ES.  ES starts up just fine but when I tried to view 
marvel I get an exception within ES:

[2015-02-24 16:10:14,462][WARN ][http.netty   ] [Kid Nova] 
Caught exception while handling client http traffic, closing connection 
[id: 0xc3000144, /0:0:0:0:0:0:0:1:51607 => /0:0:0:0:0:0:0:1:9200]
org.elasticsearch.common.netty.handler.codec.frame.TooLongFrameException: 
HTTP header is larger than 8192 bytes.

The only thing that I changed was the cluster name in the .yml file, 
nothing else was touched.

This exception happens in Chrome, in FF Developer Edition it runs just 
fine.  

What's up with that?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/498c3032-5108-4318-b443-b2c2bae60c78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ElasticSearch C# client (NEST): access nested aggregation results

2015-01-23 Thread Jay Hilden
I'm trying to use the C# plugin to retrieve data from a nested aggregation. 
 If anyone could help that would be most appreciated.  Here is the Stack 
Overflow question.

http://stackoverflow.com/questions/28096723/elasticsearch-c-sharp-client-nest-access-nested-aggregation-results

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/73f7e411-123b-4e83-9806-a98b04cf8eb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: aggregation giving inconsistent results

2014-10-31 Thread Jay Hilden
Thanks Adrien, your link was very helpful in understanding why I was
getting the results I'm getting.  Doing some experimentation on our data
I'm going to use a 20x multiplier on the shard_count against the size.  So
in my testing when I want the top 5 results for a very flat term I'm going
to set shard_size to 100 (5*20) and that is giving me accurate results.

Thanks again!

On Fri, Oct 31, 2014 at 3:44 AM, Adrien Grand <
adrien.gr...@elasticsearch.com> wrote:

> This is unfortunately a known limitation of the terms aggregation. Note
> however that elasticsearch 1.4 (only a beta version is available today but
> the GA release should be available within a couple of weeks) improves some
> heuristics which allow to have a better accuracy by default, and also
> reports an error bound on the document counts that are returned.
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-approximate-counts
>
> On Thu, Oct 30, 2014 at 5:48 PM, Jay Hilden  wrote:
>
>> I'm running an aggregation and getting the top 5 results.  When I run the
>> exact same aggregation on the top 50 results I'm getting totally different
>> results.  I expect that when asking for 50 the top 5 should remain the same
>> and an additional 45 should be added to the list.  That is not what's
>> happening.
>>
>> Note: I'm aggregating on the non_analyzed part of a multi-field
>> authInput.userName, I'm not sure if that makes a difference or not.
>>
>> *Here is my query: *
>>
>> GET prodstarbucks/authEvent/_search
>> {
>>   "size": 0,
>>   "aggs": {
>> "users": {
>>   "terms": {
>> "field": "authInput.userName.userNameNotAnalyzed",
>> "size": 5
>>   }
>> }
>>   },
>>   "query": {
>> "filtered": {
>>   "query": {
>> "match_all": {}
>>   },
>>   "filter": {
>> "bool": {
>>   "must": [
>> {
>>   "range": {
>> "authResult.authEventDate": {
>>   "gte": "2014-10-01T00:00:00.000",
>>   "lte": "2014-10-31T00:00:00.000"
>> }
>>   }
>> }
>>   ]
>> }
>>   }
>> }
>>   }
>> }
>>
>> *RESULT:*
>> {
>>"took": 2171,
>>"timed_out": false,
>>"_shards": {
>>   "total": 5,
>>   "successful": 5,
>>   "failed": 0
>>},
>>"hits": {
>>   "total": 1090455,
>>   "max_score": 0,
>>   "hits": []
>>},
>>"aggregations": {
>>   "users": {
>>  "buckets": [
>> {
>>"key": "3D64E4FD-6D25-4E77-966E-A0E059CFD31E",
>>"doc_count": 91
>> },
>> {
>>"key": "3982EC96-DB4C-4A22-AC64-2CFC09D52579",
>>"doc_count": 68
>> },
>> {
>>"key": "674E6691-8A46-4D34-BB31-B78780969311",
>>"doc_count": 24
>> },
>> {
>>"key": "64449480-77AC-4D64-B79D-DDB545BEE472",
>>"doc_count": 23
>> },
>> {
>>"key": "{7CB63FEE-709A-4AD5-AA16-2CFE3282FEE8}",
>>"doc_count": 23
>> }
>>  ]
>>   }
>>}
>> }
>>
>> If I change the aggregation size to be 50, these are my top 5 results:
>> {
>>"took": 2256,
>>"timed_out": false,
>>"_shards": {
>>   "total": 5,
>>   "successful": 5,
>>   "failed": 0
>>},
>>"hits": {
>>   "total": 1090501,
>>   "max_score": 0,
>>   "hits": []
>>},
>>"aggregations": {
>>   "users": {
>>  &q

aggregation giving inconsistent results

2014-10-30 Thread Jay Hilden
I'm running an aggregation and getting the top 5 results.  When I run the 
exact same aggregation on the top 50 results I'm getting totally different 
results.  I expect that when asking for 50 the top 5 should remain the same 
and an additional 45 should be added to the list.  That is not what's 
happening.

Note: I'm aggregating on the non_analyzed part of a multi-field 
authInput.userName, I'm not sure if that makes a difference or not.

*Here is my query: * 

GET prodstarbucks/authEvent/_search
{
  "size": 0,
  "aggs": {
"users": {
  "terms": {
"field": "authInput.userName.userNameNotAnalyzed",
"size": 5
  }
}
  },
  "query": {
"filtered": {
  "query": {
"match_all": {}
  },
  "filter": {
"bool": {
  "must": [
{
  "range": {
"authResult.authEventDate": {
  "gte": "2014-10-01T00:00:00.000",
  "lte": "2014-10-31T00:00:00.000"
}
  }
}
  ]
}
  }
}
  }
}

*RESULT:*
{
   "took": 2171,
   "timed_out": false,
   "_shards": {
  "total": 5,
  "successful": 5,
  "failed": 0
   },
   "hits": {
  "total": 1090455,
  "max_score": 0,
  "hits": []
   },
   "aggregations": {
  "users": {
 "buckets": [
{
   "key": "3D64E4FD-6D25-4E77-966E-A0E059CFD31E",
   "doc_count": 91
},
{
   "key": "3982EC96-DB4C-4A22-AC64-2CFC09D52579",
   "doc_count": 68
},
{
   "key": "674E6691-8A46-4D34-BB31-B78780969311",
   "doc_count": 24
},
{
   "key": "64449480-77AC-4D64-B79D-DDB545BEE472",
   "doc_count": 23
},
{
   "key": "{7CB63FEE-709A-4AD5-AA16-2CFE3282FEE8}",
   "doc_count": 23
}
 ]
  }
   }
}

If I change the aggregation size to be 50, these are my top 5 results:
{
   "took": 2256,
   "timed_out": false,
   "_shards": {
  "total": 5,
  "successful": 5,
  "failed": 0
   },
   "hits": {
  "total": 1090501,
  "max_score": 0,
  "hits": []
   },
   "aggregations": {
  "users": {
 "buckets": [
{
   "key": "3D64E4FD-6D25-4E77-966E-A0E059CFD31E",
   "doc_count": 109
},
{
   "key": "3982EC96-DB4C-4A22-AC64-2CFC09D52579",
   "doc_count": 84
},
{
   "key": "F77E8291-1640-4C3F-8A1A-D6D955AB940A",
   "doc_count": 59
},
{
   "key": "6AC1ED48-8F91-400B-9353-172BB6E1823B",
   "doc_count": 53
},
{
   "key": "52CDF454-92C2-4C32-91F6-AF4F08C8F908",
   "doc_count": 52
},
...


The doc_counts are all different.  Can someone help explain this to me and 
let me know how I might get the correct doc_count even when only asking for 
the top 5 results.

Thank you!

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/3e7e5a69-59ee-4472-abb5-598258f97341%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: nested aggregation against key value pairs

2014-10-27 Thread Jay Hilden
Thanks Adrien.

On Mon, Oct 27, 2014 at 12:12 PM, Adrien Grand <
adrien.gr...@elasticsearch.com> wrote:

> Hi Jay,
>
> Reindexing and having a key that combines the key and value fields would
> certainly be the fastest option.
>
>
> On Mon, Oct 27, 2014 at 1:52 PM, Jay Hilden  wrote:
>
>> Here is some sample data:
>>
>> PUT index1
>>
>> PUT index1/type1/_mapping
>> {
>>   "type1": {
>> "properties": {
>>   "kvp": {
>> "type": "nested",
>> "properties": {
>>   "key": {
>> "type": "string"
>>   },
>>   "value": {
>> "type": "string"
>>   }
>> }
>>   }
>> }
>>   }
>> }
>>
>> POST index1/type1
>> {
>>   "kvp": [
>> {
>>   "key": "key1",
>>   "value": "value1"
>> }
>>   ]
>> }
>>
>> POST index1/type1
>> {
>>   "kvp": [
>> {
>>   "key": "key1",
>>   "value": "value1"
>> },
>> {
>>   "key": "key1",
>>   "value": "value2"
>> },
>> {
>>   "key": "key2",
>>   "value": "value1"
>> },
>> {
>>   "key": "key2",
>>   "value": "value2"
>> }
>>   ]
>> }
>>
>> The result I'd like combines the fields "kvp.key" and "kvp.value":
>> key1 - value1: DocCount = 2
>> key1 - value2: DocCount = 1
>> key2 - value2: DocCount = 1
>>
>> I'm starting to think that I need to re-index the data and combine the
>> "kvp.key" and "kvp.value" fields into a single field so that I can
>> aggregate on it.
>>
>> On Friday, October 24, 2014 2:17:04 PM UTC-5, Jay Hilden wrote:
>>>
>>> I have an ES type with a nested KeyValuePair type.  What I'm trying to
>>> do is a terms aggregation on both the key and value fields such that I'd
>>> get the following results:
>>>
>>> Key1 - Value1: DocCount = 10
>>> Key1 - Value2: DocCount = 9
>>> Key2 - Value3: DocCount = 4
>>>
>>> Here is my mapping:
>>> {
>>> "index123" : {
>>> "mappings" : {
>>> "type123" : {
>>> "properties" : {
>>> "authEventID" : {
>>> "type" : "long"
>>> },
>>> "authInput" : {
>>> "properties" : {
>>> "uIDExtensionFields" : {
>>> "type" : "nested",
>>> "properties" : {
>>> "key" : {
>>> "type" : "string"
>>> },
>>> "value" : {
>>> "type" : "string"
>>> }
>>> }
>>> }
>>> }
>>> }
>>> }
>>> }
>>> }
>>> }
>>> }
>>>
>>> Is there a way to do this?
>>>
>>> Thank you.
>>>
>>  --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elasticsearch/d9db4ea8-68af-4cc5-a6dc-876f218b58f7%40googlegroups.com
>> <https://groups.google.com/d/msgid/elasticsearch/d9db4ea8-68af-4cc5-a6dc-876f218b58f7%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Adrien Grand
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "elasticsearch" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elasticsearch/NJRzaH6FUfY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> elasticsearch+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7j2Shpz1G7GhpFA5Oqy8ReCWTHrF_D3QJPNjsHQGMcQw%40mail.gmail.com
> <https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7j2Shpz1G7GhpFA5Oqy8ReCWTHrF_D3QJPNjsHQGMcQw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAD3qxy53ggTWrK4taryaLe7jPu%3DSPJMNeUzbnzbO%2B%3D_EzbdTBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: nested aggregation against key value pairs

2014-10-27 Thread Jay Hilden
Here is some sample data:

PUT index1

PUT index1/type1/_mapping
{
  "type1": {
"properties": {
  "kvp": {
"type": "nested",
"properties": {
  "key": {
"type": "string"
  },
  "value": {
"type": "string"
  }
}
  }
}
  }
}

POST index1/type1
{
  "kvp": [
{
  "key": "key1",
  "value": "value1"
}  
  ]
}

POST index1/type1
{
  "kvp": [
{
  "key": "key1",
  "value": "value1"
},
{
  "key": "key1",
  "value": "value2"
},
{
  "key": "key2",
  "value": "value1"
},
{
  "key": "key2",
  "value": "value2"
}
  ]
}

The result I'd like combines the fields "kvp.key" and "kvp.value":
key1 - value1: DocCount = 2
key1 - value2: DocCount = 1
key2 - value2: DocCount = 1

I'm starting to think that I need to re-index the data and combine the 
"kvp.key" and "kvp.value" fields into a single field so that I can 
aggregate on it.

On Friday, October 24, 2014 2:17:04 PM UTC-5, Jay Hilden wrote:
>
> I have an ES type with a nested KeyValuePair type.  What I'm trying to do 
> is a terms aggregation on both the key and value fields such that I'd get 
> the following results:
>
> Key1 - Value1: DocCount = 10
> Key1 - Value2: DocCount = 9
> Key2 - Value3: DocCount = 4
>
> Here is my mapping:
> {
> "index123" : {
> "mappings" : {
> "type123" : {
> "properties" : {
> "authEventID" : {
> "type" : "long"
> },
> "authInput" : {
> "properties" : {
> "uIDExtensionFields" : {
> "type" : "nested",
> "properties" : {
> "key" : {
> "type" : "string"
> },
> "value" : {
> "type" : "string"
> }
> }
> }
> }
> }
> }
> }
> }
> }
> }
>
> Is there a way to do this?
>
> Thank you.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/d9db4ea8-68af-4cc5-a6dc-876f218b58f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


nested aggregation against key value pairs

2014-10-24 Thread Jay Hilden
I have an ES type with a nested KeyValuePair type.  What I'm trying to do 
is a terms aggregation on both the key and value fields such that I'd get 
the following results:

Key1 - Value1: DocCount = 10
Key1 - Value2: DocCount = 9
Key2 - Value3: DocCount = 4

Here is my mapping:
{
"index123" : {
"mappings" : {
"type123" : {
"properties" : {
"authEventID" : {
"type" : "long"
},
"authInput" : {
"properties" : {
"uIDExtensionFields" : {
"type" : "nested",
"properties" : {
"key" : {
"type" : "string"
},
"value" : {
"type" : "string"
}
}
}
}
}
}
}
}
}
}

Is there a way to do this?

Thank you.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/c8c637c0-3933-4b1b-ad32-0c8bfe9485bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ElasticSearch - how to SUM function_score by field

2014-03-10 Thread Jay Hilden
Thanks for the response Binh.  Is there a way to pipe the response from my
first query directly into a new index without round tripping the data back
to the server that requested the query?


On Mon, Mar 10, 2014 at 1:09 PM, Binh Ly  wrote:

> Unfortunately, subqueries are not supported. What you can do is dump the
> results of your first query into an index. And then you can do a
> terms_stats facet on that dump to get your final results:
>
>
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-terms-stats-facet.html
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "elasticsearch" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elasticsearch/hiTA1hsdLr8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> elasticsearch+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/04770395-4c81-4d42-9566-df763a39fb0c%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAD3qxy56ohK9icugkoo2vebJkyXLNZfBpQterFO2ib7zU1aXFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


ElasticSearch - how to SUM function_score by field

2014-03-07 Thread Jay Hilden


I have a query that is using function_score to rank the results. Here is a 
sample of what is returned:

 {
"_index": "clone",
"_type": "authEvent",
"_id": "6431823",
"_score": 4.8,
"fields": {
   "authInput.uID": "MPXWDKW2P",
   "authResult.productValue": 1,
   "authInput.userName": "F936F3AA-E26C-48DB-BDBC-44956B634260",
   "authResult.authEventDate": "2014-02-27T09:29:30.703125-06:00",
   "authResult.rulesFailed": [
  "AuthCountByUser"
   ]
}
 }

What I want to is take the results and run the equivalent of this SQL 
statement:

SELECT TOP 20 "authInput.userName", SUM("_score")
FROM foo
GROUP BY "authInput.userName"
ORDER BY SUM("_score") DESC

How can I do this with ES? 


NOTE: I'm using ES 0.9x, we will be moving to 1.0.0 soon but we have not 
yet.


Thanks in advance!

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/dc11fcb9-8954-4d0a-8996-afd1f73290f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ES 1.0 update - why are fields returns an array when fields parameter is used?

2014-02-18 Thread Jay Hilden
Thanks Binh, that seems obvious now.  It's interesting that I can specify a
"field" query for a primitive type, or an array, but not a leaf field.  I
would have thought that a leaf field would be treated like an array, but I
suppose then it would have no name to reference on.

Thanks for the feedback.




On Tue, Feb 18, 2014 at 10:21 AM, Binh Ly  wrote:

> Jay, let's say I index another document:
>
> POST http://localhost:9200/foo/bar
> { "foo": ["bar", "bar2"] }
>
> Then when I query again, it would yield the results like you asked.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "elasticsearch" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elasticsearch/1dMSGYmJcyw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> elasticsearch+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/cd31dd72-9e95-4917-8bb9-5b9e6942e7d4%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAD3qxy5oHuXG9XgegQNjZKBdPfbm0ANeiw9jN4Aee58nBdh1jg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ES 1.0 update - why are fields returns an array when fields parameter is used?

2014-02-18 Thread Jay Hilden
Binh, thank you for your response, I have created a similar test scenario 
and verified that I get the same results.  My question is why is ["bar"] an 
array object at all?  Under what conditions would it be possible to have a 
return value of "bar2" like my example below:

{
  "hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
  "_index" : "foo",
  "_type" : "bar",
  "_id" : "w34aAgVpQ9GJ0PJ4LqyYLQ",
  "_score" : 1.0,
  "fields" : {
"foo" : [ "bar", "bar2" ]
  }
} ]
  }
}

Thanks!

On Tuesday, February 18, 2014 9:55:20 AM UTC-6, Binh Ly wrote:
>
> For example, if you index a doc like this: 
>
> POST http://localhost:9200/foo/bar 
> { "foo": "bar" }
>
> And then you query like this:
>
> POST http://localhost:9200/foo/_search
> {
>   "fields": ["foo"]
> }
>
> Your result will now be like this in 1.0 (note that the value bar is 
> returned as an array ["bar"] instead of just a string "bar"):
>
> {
>   "hits" : {
> "total" : 1,
> "max_score" : 1.0,
> "hits" : [ {
>   "_index" : "foo",
>   "_type" : "bar",
>   "_id" : "w34aAgVpQ9GJ0PJ4LqyYLQ",
>   "_score" : 1.0,
>   "fields" : {
> "foo" : [ "bar" ]
>   }
> } ]
>   }
> }
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/550a6264-e602-4beb-947d-e4786e5fe3f7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


ES 1.0 update - why are fields returns an array when fields parameter is used?

2014-02-17 Thread Jay Hilden
I was reading the documentation on the updated 1.0 release and saw the 
following:

"Field values, in response to the 
fields
 parameter, 
are now always returned as arrays. A field could have single or multiple 
values, which meant that sometimes they were returned as scalars and 
sometimes as arrays."

I'm trying to understand this change.  Will you please give me an example 
on where the field returned would be an array.  

Thanks in advance!



http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/_return_values.html


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/3e2e4992-99b7-445e-847c-e27a848fd993%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.