Re: I dont get results for plurals if I use Snowball

2015-05-25 Thread Jun Ohtani
You can see
https://www.elastic.co/guide/en/elasticsearch/guide/current/root-object.html#all-field
about _all field.

"It uses the default analyzer to analyze its values"

PS - We're moving to https://discuss.elastic.co/, please join us there for
any future discussions!

2015-05-22 22:37 GMT+09:00 Vishal Sharma :

> I see its an issue with match: _all query.
>
> Cant we get analyzer work with _all query?
>
> Any help is appreciated.
>
> *Vishal Sharma*
> *Team Leader, SFDC*T: +1 30­4 636 7373
> E: vish...@grazitti.com
> www.grazitti.com [image: Description: LinkedIn]
> <http://www.linkedin.com/company/grazitti-interactive>[image:
> Description: Twitter] <https://twitter.com/grazitti>[image: fbook]
> <https://www.facebook.com/grazitti.interactive>Session at *Developer*
> *Track *on 3rd June[image: Button]
> <http://go.grazitti.com/meet-us-at-Lithium-LiNC-2015-conference.html>
>
>
>
>
>
>
>
> On Fri, May 22, 2015 at 4:23 PM, Vishal Sharma 
> wrote:
>
>> Hi,
>>
>> I want to configure elastic for plurals so that searching for "blog" and
>> "blogs" return same results.
>>
>> I found on internet that the way to go is to use Snowball analyzer. When
>> I use Snowball I get same results for both "blog" and "blogs". But, the
>> results which used to come for "blogs" without the snowball analyzer in
>> query do not come at all now.
>>
>> Can someone please help?
>>
>> http://myserver:9200/_search?analyzer=snowball&q=blogs&pretty
>>
>> http://myserver:9200/_search?analyzer=snowball&q=blog&pretty
>>
>>
>>
>> *Vishal Sharma*
>> *Team Leader, SFDC*T: +1 30­4 636 7373
>> E: vish...@grazitti.com
>> www.grazitti.com [image: Description: LinkedIn]
>> <http://www.linkedin.com/company/grazitti-interactive>[image:
>> Description: Twitter] <https://twitter.com/grazitti>[image: fbook]
>> <https://www.facebook.com/grazitti.interactive>Session at *Developer*
>> *Track *on 3rd June[image: Button]
>> <http://go.grazitti.com/meet-us-at-Lithium-LiNC-2015-conference.html>
>>
>>
>>
>>
>>
>>
>>
>  --
> Please update your bookmarks! We have moved to https://discuss.elastic.co/
> ---
> 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/CAGMB1maNJpad5VwEZOEDx3jb_GAnRB2kb06Pyd68gQP5aN8XNw%40mail.gmail.com
> <https://groups.google.com/d/msgid/elasticsearch/CAGMB1maNJpad5VwEZOEDx3jb_GAnRB2kb06Pyd68gQP5aN8XNw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
Please update your bookmarks! We have moved to https://discuss.elastic.co/
--- 
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/CAPW8A5yw2Px57Uad3D4tujgX3ev%2BO5Vh3R2JL1ZhZz%2BJ-iB_Ng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unique node id for elasticsearch node

2015-05-25 Thread Jun Ohtani
Hi,
You can use `full_id` parameter with _cat API.

"GET _cat/nodes?v&full_id=true&h=id"


PS - We're moving to https://discuss.elastic.co/, please join us there for
any future discussions!


2015-05-25 20:40 GMT+09:00 Debayan Banerjee :

> Hi,
>
> I want to know the node unique ID for an elasticsearch node via an API.
> There is
> https://www.elastic.co/guide/en/elasticsearch/reference/1.3/cat-nodes.html
> but it only shows a four letter abbreviated ID. I need the full ID so I can
> parse the output of
> https://www.elastic.co/guide/en/elasticsearch/reference/1.5/cluster-nodes-stats.html
> which requires prior knowledge of node ID.
>
> Please help.
>
> --
>
> Debayan Banerjee
> devOps engineer
> +91 8800846550
>
>  --
> Please update your bookmarks! We have moved to https://discuss.elastic.co/
> ---
> 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/CAOvawCtU3-%3DdY4a%3DmFJuDERRPRX0S8HL0BD7qVYbW6JRFaLGsg%40mail.gmail.com
> <https://groups.google.com/d/msgid/elasticsearch/CAOvawCtU3-%3DdY4a%3DmFJuDERRPRX0S8HL0BD7qVYbW6JRFaLGsg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
Please update your bookmarks! We have moved to https://discuss.elastic.co/
--- 
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/CAPW8A5xiZn_HR3wwMJ84gigEYf5aXv2kzG8CAZiLRHU4%3Dj0kWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cumulative mode in bar chart for kibana 4?

2015-05-23 Thread Jun Ohtani
Hi Yu,

We should move this discussion to our new web forum.
https://discuss.elastic.co/c/in-your-native-tongue/18-category

We can discuss using Japanese languages.
Please move this discussion to there.
2015/05/23 18:52 "Yu Watanabe" :

> 大谷さん
>
> 質問者の渡辺です。
>
> まず、お忙しい中回答いただきありがとうございます。
>
> ただ、アドバイスいただいた通りに、(X-Axisのフィルタは若干変えました)
> 実施しましたが、うまくいきませんでした。
>
> 添付のbarchart1.pngが結果です。
>
> 私が、イメージしているのは、barchart2.pngになります。
> 各月のグラフが、その月までの総和になるようにしたいです。
> kibana 3ではcumulativeオプションがあったので楽だったのですが、
> kibana 4では四苦八苦
>
> X-axisでDate Histogramにしないと、
> x軸が月単位に分割できないのは理解できたのですが、
> これだとbucketが月単位で検索され、
> うまくその月までのデータを抽出できていない気がします。
>
> もし、またアドバイスを頂けるようでしたらよろしくお願いいたします。
> また、せっかくなので、LinkedInでconnectさせていただけると幸いです。
>
> 以上です。
>
> On Fri, May 15, 2015 at 1:09 PM, Jun Ohtani  wrote:
>
>> Hi Yu,
>>
>> I'm not sure the data which you have.
>> I think you can use Kibana4 .
>>
>> First, you choose bar chart and use Filters aggs for X-Axis.
>> Query1 @timestamp:[* TO "2015-04-30"], Query2, @timestamp:[* TO
>> "2015-05-31"]
>> Then, Kibana4 display the bar chart.
>>
>> And if you add Split Bars with Date Histgram for @timestamp field and
>> choose Interval monthly,
>> you can see split bar color per month.
>>
>> Does it make sense?
>>
>>
>> 2015-04-29 19:06 GMT+09:00 Yu Watanabe :
>>
>>> Hi!
>>>
>>> I was wondering is there a cumulative mode for bar chart
>>> which existed in kibana 3?
>>>
>>> I am considering to show the overall sum of past values for each period.
>>>
>>> For example, if following points had
>>>
>>> 2015 apr:   1
>>> 2015 may  :   2
>>> 2015 june   :  1
>>>
>>> In the bar chart , I want to show as
>>>
>>> 2015 overall total apr:  1
>>> 2015 overall total may  :  3
>>> 2015 overall total june  :  5
>>>
>>> Is this still possible in kibana 4?
>>>
>>> Thanks,
>>> yu
>>>
>>> --
>>> 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/837ddc0b-91fc-488d-9c02-d4571e8a4d98%40googlegroups.com
>>> <https://groups.google.com/d/msgid/elasticsearch/837ddc0b-91fc-488d-9c02-d4571e8a4d98%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> ---
>> Jun Ohtani
>> blog : http://blog.johtani.info
>>
>> --
>> Please update your bookmarks! We have moved to
>> https://discuss.elastic.co/
>> ---
>> 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/Q1zoHXUi3r0/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/CAPW8A5zv45tixmw4i7bqqc_sFrn6AvUQTu-nUDvsfm6s3HtMqg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/elasticsearch/CAPW8A5zv45tixmw4i7bqqc_sFrn6AvUQTu-nUDvsfm6s3HtMqg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Yu Watanabe
> 渡辺 裕
>
> LinkedIn : jp.linkedin.com/in/yuwatanabe1
>
> --
> Please update your bookmarks! We have moved to https://discuss.elastic.co/
> ---
> 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/CALKrq%3D%3DXu3wV6MVmekQms7Bt6UOUvnwzzVRRGXaMS%2Bg9CC3r7g%40mail.gmail.com
> <https://groups.google.com/d/msgid/elasticsearch/CALKrq%3D%3DXu3wV6MVmekQms7Bt6UOUvnwzzVRRGXaMS%2Bg9CC3r7g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Please update your bookmarks! We have moved to https://discuss.elastic.co/
--- 
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/CAPW8A5y8SqR4EP%2BnBco8SiW7qirOwXF41Q5MCV7HZX%2B1FSLt%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cannot get ElasticSearch Config to Create Custom Analyzers

2015-05-15 Thread Jun Ohtani
Hi Wil,

You should change `supplyhogText` to `default` in line 2, and delete last
line.


2015-04-28 4:51 GMT+09:00 Wil Wade :

> PasteBin of my attempted config: http://pastebin.com/175jeAMB
>
> ElasticSearch 1.5.2
>
> So I want to have a custom default analyzer, but after days of trying (and
> almost every Google link turned purple), have failed to get it to work.
>
> All I get back out is:
> ...
>
> ElasticsearchIllegalArgumentException[failed to find analyzer type
> [supplyhogText] or tokenizer for [default]]
>
> ...
>
> for each index.
>
> I have tried setting it up without the "
> index.analysis.analyzer.default.type: "supplyhogText"" line, but it is
> like it doesn't see my definition lines.
>
> Must be something really simple my tired eyes cannot see. Any ideas?
>
> --
> 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/14e8b5a1-e2e9-4914-b164-d585098bdaf9%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/14e8b5a1-e2e9-4914-b164-d585098bdaf9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
Please update your bookmarks! We have moved to https://discuss.elastic.co/
--- 
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/CAPW8A5zNDiTKLATpi%2B%2BMET2Lp4mOhMHbhORh97qPA4gtBg3jgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cumulative mode in bar chart for kibana 4?

2015-05-14 Thread Jun Ohtani
Hi Yu,

I'm not sure the data which you have.
I think you can use Kibana4 .

First, you choose bar chart and use Filters aggs for X-Axis.
Query1 @timestamp:[* TO "2015-04-30"], Query2, @timestamp:[* TO
"2015-05-31"]
Then, Kibana4 display the bar chart.

And if you add Split Bars with Date Histgram for @timestamp field and
choose Interval monthly,
you can see split bar color per month.

Does it make sense?


2015-04-29 19:06 GMT+09:00 Yu Watanabe :

> Hi!
>
> I was wondering is there a cumulative mode for bar chart
> which existed in kibana 3?
>
> I am considering to show the overall sum of past values for each period.
>
> For example, if following points had
>
> 2015 apr:   1
> 2015 may  :   2
> 2015 june   :  1
>
> In the bar chart , I want to show as
>
> 2015 overall total apr:  1
> 2015 overall total may  :  3
> 2015 overall total june  :  5
>
> Is this still possible in kibana 4?
>
> Thanks,
> yu
>
> --
> 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/837ddc0b-91fc-488d-9c02-d4571e8a4d98%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/837ddc0b-91fc-488d-9c02-d4571e8a4d98%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
Please update your bookmarks! We have moved to https://discuss.elastic.co/
--- 
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/CAPW8A5zv45tixmw4i7bqqc_sFrn6AvUQTu-nUDvsfm6s3HtMqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Dynamic Mappings for language related Fields

2015-05-14 Thread Jun Ohtani
Hi

`_all` field is metadata field.
It uses the default analyzer to analyze its values.

This section will help you.
http://www.elastic.co/guide/en/elasticsearch/guide/current/root-object.html#all-field

And the following article, Dealing with Human Language, will help you to
deal with multi languages.
http://www.elastic.co/guide/en/elasticsearch/guide/current/language-intro.html

2015-05-04 0:26 GMT+09:00 :

> Hello,
> I have a system with multiple fields, some in English and some in
> Japanese, I have installed a plugin and after a bit of help added the
> mapping and it worked, however, since the mapping was for a specific field
> It would not work when I queried for "_all" it did not work, I am trying to
> add a dynamic mapping for it, as below, however, It is failing:
>
> XContentBuilder xbMapping =
> jsonBuilder()
> .startObject()
> .startObject("mappings")
> .startObject(indexType)
> .startObject("dynamic_templates")
> .startObject("jp")
> .field("match", "*")
> .field("match_mapping_type", "string")
> .startObject("mapping")
> .field("type", "string")
> .field("analyzer", JAPANESE_LANGUzzAGE_ANALYSIS)
> .endObject()
> .endObject()
> .endObject()
> .endObject()
> .endObject();
>
>  elasticSearchClient.admin().indices()
> .preparePutMapping(indexName)
> .setType(indexType)
> .setSource(xbMapping)
> .execute().get();
>
>
> Any Ideas on what I am doing wrong? And if I add this mapping to "*" will
> I still be able to perform queries without passing the analyser? or should
> I use different types for each document I add depending on the language?
>
> 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/5efb000d-1fad-4bef-abca-ae16c503c2de%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/5efb000d-1fad-4bef-abca-ae16c503c2de%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
Please update your bookmarks! We have moved to https://discuss.elastic.co/
--- 
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/CAPW8A5yR_SQo6dZpXm7FiGFtTwDbyAFC9dDiBYh_C-N_kKRREw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multi language support on Same Index

2015-05-14 Thread Jun Ohtani
Hi Giri,

I think this article will help you.
http://www.elastic.co/guide/en/elasticsearch/guide/current/language-intro.html


2015-05-15 4:55 GMT+09:00 Giri Babu :

> I am using the version 1.4.1. I have the requirement to support
> multi-language documents on the same index. I need suggestions, sample
> codes or articles regarding the correct way of implementing this. The
> languages that i need to support are:
> English,CJK,Arabic,Russian,french,german,italian,spanish
>
>  --
> Please update your bookmarks! We have moved to https://discuss.elastic.co/
> ---
> 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/1219caae-5f36-4fd8-b3a3-14d32ee2a357%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/1219caae-5f36-4fd8-b3a3-14d32ee2a357%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
Please update your bookmarks! We have moved to https://discuss.elastic.co/
--- 
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/CAPW8A5xj3G7Ar0UOyGFmWaFz7UWib5h1n3%2B%2B6pnSk5835LYPig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Kibana as a UI Component

2015-04-14 Thread Jun Ohtani
Hi Toshi,

If it is helpful for you, then I think it is good.
http://www.elastic.co/guide/en/kibana/current/dashboard.html#sharing-dashboards

2015-03-03 6:03 GMT+09:00 Toshiyuki Hayashi :

> Hi,
>
> I'm new to Kibana. I have already a Web UI/Dashboard, then I'd like to
> integrate Kibana charts with the my web UI as a UI component (Of course the
> backend is elastic search). Do you guys have any idea how doing that?
> Kibana is using only front-end technology basically, so I think it might
> be easy to integrate with other web.
>
> Thanks,
> Toshi
>
>
>
>
>  --
> 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/c989a71d-7ab2-4573-80ae-4f21c1ed5532%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/c989a71d-7ab2-4573-80ae-4f21c1ed5532%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5zYdZ96eKmH3sUArZphSH6p%2Bgo3-E6T7-cLGU%2Bk48Gnfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: SynonymTokenFilterFactory class passes indexSettings to TokenizerFactory

2015-04-08 Thread Jun Ohtani
Hi Yosuke,

Thanks for reporting.
I think that is bug, it should work 1.5.
I will open Issue and create PR, soon.

2015-03-31 14:55 GMT+09:00 :

> Hi.
> I have a question about behavior of SynonymTokenFilterFactory class.
>
> I expect that "settings" parameter of TokenizerFactory is tokenizer's
> settings. However, SynonymTokenFilterFactory passes indexSettings to
> "settings" parameter of TokenizerFactory.
>
> final TokenizerFactory tokenizerFactory =
> tokenizerFactoryFactory.create(tokenizerName, indexSettings);
>
> SynonymTokenFilterFactory was changed by the following commit.
>
> https://github.com/elastic/elasticsearch/commit/ac4b39bd8f54c38f55a0b02f432c4ee5f47caf03#diff-594b28da352e9e981182b5466c294388
>
> Is the behavior changed?
>
>
> At Elasticsearch 1.3, the following setting works.  "bigramTokenizer" of
> synonymTest gets (min_gram/max_gram) settings.
>
> curl -XPUT localhost:9200/test -d '{
>   "settings" : {
> "analysis" : {
>   "analyzer" : {
> "bigram_analyzer" : {
>   "type" : "custom",
>   "tokenizer" : "bigramTokenizer",
>   "filter" : ["synonymTest"]
> }
>   },
>   "tokenizer" : {
>   "bigramTokenizer" : {
>   "type" : "ngram",
>   "min_gram" : 2,
>   "max_gram" : 2
> }
>   },
>   "filter" : {
> "synonymTest" : {
>   "type" : "synonym",
>   "synonyms_path" : "synonym.txt",
>   "tokenizer" : "bigramTokenizer",
>   "min_gram" : 2,
>   "max_gram" : 2
> }
>   }
> }
>   }
> }'
>
> At Elasticsearch 1.5, it does not work.
>
> Thanks in advance,
> Yosuke
>
> --
> 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/dbcceb52-7b7a-45a3-ae48-2a844f414263%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/dbcceb52-7b7a-45a3-ae48-2a844f414263%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5wXsN8jUB0zSBJwGyKPfFSPS9JD2GoKAqu5OJU0y4eEyw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: mappings: use wildcards from field name

2015-03-17 Thread Jun Ohtani
Hi,

You try to use “dynamic_templates” .
http://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-root-object-type.html#_dynamic_templates

I hope that those help you out.



Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

> 2015/02/27 2:56、sebastian  のメール:
> 
> Hi,
> 
> 
> Can I create a mapping and use wildcards in the fields name? For example, I 
> want to create a template with the following mapping:
> 
> {
> "user": {
> "dynamic": "false", 
> "properties": { 
> "email": { "type":"string" },
> "*_metadata": {
> "type": "object", 
> "dynamic": "true" 
> } 
> } 
> }
> }
> 
> Then, the "foo_metadata", "bar_metadata", etc fields will be mapped.
> 
> Is it possible?
> 
> 
> -- 
> 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/6d7d08b8-c2f2-4109-9720-c75f031092a6%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/772DDFF6-B4D6-4BFD-BAE8-8BDA63BB78C6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Elasticsearch ICU Analysis plugin for 1.4.3 / proper Lucene version

2015-03-17 Thread Jun Ohtani
Hi,

I’m not sure about that.

Do you install ICU plugin version 2.4.1 to Elasticsearch 1.4.3?

If you would like to install ICU plugin to Elasticsearch 1.4.3, you should use 
ICU plugin 2.4.2.

bin/plugin install elasticsearch/elasticsearch-analysis-icu/2.4.2


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

> 2015/03/18 1:34、JZ  のメール:
> 
> Dear all,
> 
> I am wondering whether you can provide a compiled version of the ICU Analysis 
> plugin for Elasticsearch 1.4.3. I have tried to install the plugin version 
> 1.4.2 on ES 1.4.3 but then I get this error on restarting:
> 
> cannot start plugin due to incorrect Lucene version: plugin [4.10.3], node 
> [4.10.2].
> 
> See:
> https://github.com/elastic/elasticsearch-analysis-icu
> 
> I have tried to compile it from source, but then I get Maven dependency 
> errors returned.
> 
> Thanks in advance!
> 
> /JZ
> 
> -- 
> 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/CAA%2BD3eXq7jKOFOEJjBftQRCK%3DJ%2Bw6%2BUw7PHrjMWG8_w%2B%3Dshv%3DA%40mail.gmail.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/38A4A33E-816C-41CC-A552-25248E65E8AC%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Elasticsearch Index Polygons?

2015-02-23 Thread Jun Ohtani
Hi,

Will this help you?
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/indexing-geo-shapes.html

2015-02-24 14:38 GMT+09:00 Sai Asuka :

> So I see the elasticsearch claims to use "GeoJSON" as the format for
> indexing... but when I look at the docs.. the same it gives is:
>
>
> {
> "location" : {
> "type" : "polygon",
> "coordinates" : [
> [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 
> 0.0] ]
> ]
> }
> }
>
>
> Doesn't GeoJSON look like this?
>
> {
> "type": "Feature",
> "properties": {
>"name": "Sparkle",
>"age": 11
> },
> geometry: {
>   "type" : "polygon",
>   "coordinates" : [[[100.0, 0.0], [101.0,0.0], [101.0, 1.0], [100.0],
> [100.0, 0.0]]]
> }
> }
>
> My question is how do I index polygons in elasticsearch if I want to
> attach properties to it? If I wanted to perform a bulk load for example,
> what does one document look like that has polygon information that I can
> perform geospatial queries on?
>
> --
> 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/41cd2d8a-e5e1-450b-bb2f-d9ddac69633b%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/41cd2d8a-e5e1-450b-bb2f-d9ddac69633b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5yKUahAPmHRVMTY5o-rK45YQ9TijXtuBSYP9UBeapEREA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Range query on multi-value field?

2015-02-04 Thread Jun Ohtani
Hi Rural,

Yes. An example is following

POST /multi_valued/sample/1
{
  "prices" : [100,200,300,1000]
}

POST /multi_valued/sample/2
{
  "prices" : [400,1000]
}

GET /multi_valued/sample/_search
{
  "query": {
"range": {
  "prices": {
"gte”: 100,
"lte": 300
  }
}
  }
}

 -> Results : 1 

GET /multi_valued/sample/_search
{
  "query": {
"range": {
  "prices": {
"gte": 600,
"lte": 1000
  }
}
  }
}

-> Results 1 and 2

Does it make sense?


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

> 2015/02/04 21:07、Rural Hunter  のメール:
> 
> I have a field with multi values like this: "100, 200, 300,1000". I need to 
> get the docs which contains any value from 100 to 500 in this filed. Is it 
> possible to run a range query against this multi-value field?
> 
> -- 
> 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/CAOe1oo8Xm_6h-xQNjLz%2B85h-c3QHR8LXC%2BbTn-gYt9_9i078gg%40mail.gmail.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/E21E36FE-446F-4862-AA38-B6EF4C44D74E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: not_analyzed String search

2015-01-21 Thread Jun Ohtani
Hi Messias, 

You should set “lowercase_expanded_terms” param to false.
Default it true.
See : 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-dsl-query-string-query

“query_string” query is changed automatically query-terms to lower-case in some 
cases.
i.e. wildcard, prefix, fuzzy…


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

> 2015/01/22 3:34、Messias  のメール:
> 
> Hi,
> 
> I have the following issue when I search on a not_analyzed String.
> 
> Mapping:
> filename: {
> type: "string",
> index: "not_analyzed"
> }
> 
> 
> field: "filename"
> value: "Stream_Flash_Video_129518.log"
> 
> query_string: filename:*lash* -- get results
> query_string: filename:*Flash* -- get no results
> query_string: filename:*flash* -- get no results
> query_string: filename:*129518* -- get results
> 
> Why does filename:*Flash* get no results?
> I dont understand the the logic that ES use. If I have a string with this 
> value.
> And i use a regex .*Flush.* (what is sthe same as *Flush*) then it will match.
> 
> How is it possible to search this value with a query_string?
> 
> On an analyzed filed it works.
> Best regards
> Messias
> 
> -- 
> 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/f434f7da-2328-43bc-b113-06be660fd489%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/B70A9D24-2180-4F18-B6C5-2F8653B4BB68%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: mapping definition help (copy_to, dates)

2014-12-06 Thread Jun Ohtani
Hi Jeff,

elasticsearch doesn’t have “timestamp” type. elasticsearch have only date type.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#date

And you should use “transform” instead of “copy_to”.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-transform.html

Example mapping using transform:
{ 
  "mappings": {
"utilization": {
"dynamic": "false", 

"transform" : {
"script" : "if (!ctx._source['cst_observed'].empty && 
!ctx._source['date_observed'].empty) ctx._source['my_ts'] = 
ctx._source['cst_observed'] + ' '+ ctx._source['date_observed']",
"lang": "groovy"
},
"properties": {
"cst_observed": {"type": "string"}
,"date_observed": {"type": "string"}
,"inbound_mbps": {"type": "float"}
,"inbound_percent": {"type": "float"}
,"ip_addr": {"type": "ip"}
,"outbound_mbps": {"type": "float"}
,"outbound_percent": {"type": "float"}
,"provider": {"type": "string"}
,"reporting_begin": {"type": "date"}
,"reporting_end": {"type": "date"}
,"speed": {"type": "float"}
,"my_ts":{"type": "date", "format": "HH:mm:ss mm/dd/"}
  }
}
  }
}


That is only example. 
I hope that those help you out.


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

> 2014/11/18 13:40、Jeff Fogarty  のメール:
> 
> I'm looking to analyze network utilization data supplied by our vendor.  One 
> challenge is the observed data and time are in separate fields.  
> 
> I like to combine the fields date_observed and cst_observed into a date/time 
> field.  Is this possible?
> 
> Below defines that mapping I've come up with,  I get a few errors with the 
> below
> 
> No handler for type [timestamp] declared on fields 
> my_ts
> cst_observed
> 
> { "mappings": {
> "utilization": {
> "dynamic": "false", "properties": {
> "cst_observed": {"type": "timestamp", "copy_to": "my_ts"}
> ,"date_observed": {"type": "date", "copy_to": "my_ts"}
> ,"inbound_mbps": {"type": "float"}
> ,"inbound_percent": {"type": "float"}
> ,"ip_addr": {"type": "ip"}
> ,"outbound_mbps": {"type": "float"}
> ,"outbound_percent": {"type": "float"}
> ,"provider": {"type": "string"}
> ,"reporting_begin": {"type": "date"}
> ,"reporting_end": {"type": "date"}
> ,"speed": {"type": "float"}
> ,"my_ts":{"type": "timestamp", "format": "HH:mm:ss 
> mm/dd/"}
> }
> }
> }
> }'
> 
> Thanks,
> 
> -- 
> 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/0109138a-4f04-4f66-9ab5-2f7f85fc9a77%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/B58F56BA-643C-4B75-98E3-35DB5282FE73%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: understaning terms syntax

2014-12-06 Thread Jun Ohtani
Hi GX,

“term" query does NOT analyzed your string.
See: 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-query.html#query-dsl-term-query

On the other hand, “query_string” query analyze your string.

If you want to know the difference, you can use _validate API.
See : 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-validate.html#search-validate

Example commands are as follows:

GET hoge/fuga/_validate/query?explain
{
   "query": {
"term": {
"ac": "3A822F3B-3ECF-4463-98F86DF6DE28EC5C"
}
}
}

GET  hoge/fuga/_validate/query?explain
{
  "query": {
 "query_string" : {
  "default_field" : "ac",
  "query" : "3A822F3B-3ECF-4463-98F86DF6DE28EC5C"
  }
  }
}

I hope that those help you out.



Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

> 2014/11/21 14:45、GX  のメール:
> 
> Hi All
> 
> Im having the following scenario (elasticsearch 1.0):
> the query 
>"query": {
> "term": {
> "ac": "3A822F3B-3ECF-4463-98F86DF6DE28EC5C"
> }
> }
> 
> yields no results
> 
> but this works
> 
> "query": {
>  "query_string" : {
>   "default_field" : "ac",
>   "query" : "3A822F3B-3ECF-4463-98F86DF6DE28EC5C"
>   }
>   }
> 
> the problem is when I combine it with a "must_not" or "not" filter I still 
> get the same results
> 
> what is the correct syntax I need?
> 
> Thanks
> 
> GX
> 
> -- 
> 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/a1f4c507-f85a-4ebd-b71f-4962259abf5a%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/634B3D51-39A8-469D-938A-A6F5BCDA2D67%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ElasticSearch saving integer field as String

2014-12-06 Thread Jun Ohtani
Hi Rashmi,

Do not you set “type” in Logstash configuration?

If you don’t set, logstash use “logs” for “index_type” in output elasticsearch.
See : 
https://github.com/elasticsearch/logstash/blob/1.4/lib/logstash/outputs/elasticsearch.rb#L300

Then you should change “logs” instead of “user” in your mappings in template.



Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

> 2014/11/25 3:39、Rashmi Gogia  のメール:
> 
> Hi,
> 
> Could some one help me figure out what is the issue with below Logstash 
> Configuration /mapping template . ES seems to ignore the mappings specified 
> in the template and stores everything as string.
> 
> I am using Logstash csv plugin to create index. My logstash conf file has csv 
> filter as below:
> 
> filter {
>   csv {
> columns => ["ESpeedRef","ProcessName",TotalMilliSec,AnyFloatNumber]
> separator => ","
>   }
> 
> output {
> elasticsearch{
> protocol => "http"
> host => "localhost"
> index => "test_index"
>   }
> }
> 
> 
> 
> Below json template is used to define field mappings. I use curl to send 
> template to ES.
> 
> {"template": "test_index",
> "settings": {
> "number_of_shards": 1
> },
> "mappings": {
> "user": {
> "properties": {
> "ESpeedRef": {"type" : "string"},
> "ProcessName": {"type" : "string"},
> "TotalMilliSec": {"type" : "integer"},
> "AnyFloatNumber": {"type" : "float"}
> }
> }
> }
> }
> 
> 
> When creating index, Elastic Search does apply this template. I can confirm 
> this my looking at below console stmts:
> 
> [2014-11-24 13:22:51,099][INFO ][cluster.metadata ] [Captain America] 
> [
> test_index] creating index, cause [auto(bulk api)], shards [1]/[1], mappings
> [user]
> [2014-11-24 13:22:51,146][INFO ][cluster.metadata ] [Captain America] 
> [
> test_index] update_mapping [logs] (dynamic)
> 
> 
> In Kibana i see the fields TotalMilliSec and AnyFloatNumber are saved as 
> string.. why??
> 
> Thanks
> Rashmi
> 
> 
> 
> -- 
> 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/568cb316-5946-4fbc-ad87-f65a413b990d%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/EE908F38-2DED-4624-A4CD-2E3DC9774C65%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Aggregations with dates & scripts

2014-12-06 Thread Jun Ohtani
Hi Guillaume,

You should use doc[‘end_date’].value instead of doc[‘end_date’] .
See : 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html#_document_fields

And you should use 360 instead of 3600. 
Date type is a long number representing UTC milliseconds since the epoch.

See : 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#date

I hope that those help you out.



Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

> 2014/12/04 7:47、Guillaume Alleon  のメール:
> 
> Hi 
> 
> I have  a mapping which is having the following 2 properties:
> "start_date": {
> "format": "dateOptionalTime",
> "type": "date"
> },
> "end_date": {
> "format": "dateOptionalTime",
> "type": "date"
> },
> 
> I want to create an histogram for durations with 1 hour intervals by doing  
> this:
> 
> curl -XGET 'http://localhost:9200/myindex/travels/_search_search?pretty' -d '
> {
> 
> "aggs": {
> 
> "duration": {
> 
> "histogram": {
> 
> "interval": 1,
> 
> "script": "(doc['end_date']-doc['start_date'])/3600"
> 
> }
> 
> }
> 
> }
> 
> }'
> 
> I got the following error:
> 
> GroovyScriptExecutionException[MissingPropertyException[No such property: 
> end_date for class: Script1]]; }{[B4xwr8FCSnOLkrNAVhgHMg][gequest][2]: 
> QueryPhaseExecutionException[[myindex][2]: 
> query[ConstantScore(cache(_type:travels))],from[0],size[10]: Query Failed 
> [Failed to execute main query]]; nested: 
> GroovyScriptExecutionException[MissingPropertyException[No such property: 
> end_date for class: Script1]]; }
> 
> I have the same error for start_date.
> 
> 
> 
> Any idea what I am doing wrong ?
> 
> 
> 
> Cheers
> 
> Guillaume
> 
> 
> -- 
> 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/6ca86563-5881-4004-af35-a258841ec326%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/C3D0F8B9-CAA7-46A9-ACC0-505D6C0F22F8%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Query_string search containing a dash has unexpected results

2014-11-07 Thread Jun Ohtani
Hi Dave,

I think the reason is your "message" field using "standard analyzer".
Standard analyzer divide text by "-".
If you change analyzer to whitespace analyzer, it matches 0 documents.

_validate API is useful for checking exact query.
Example request:

curl -XGET "/YOUR_INDEX/_validate/query?explain" -d'
{
  "query": {
"query_string": {
  "query": "id:3955974 AND message:welcome-doesnotmatchanything"
}
  }
}'

You can get the following response. In this example, "message" field is
"index": "not_analyzed".
{
   "valid": true,
   "_shards": {
  "total": 1,
  "successful": 1,
  "failed": 0
   },
   "explanations": [
  {
 "index": "YOUR_INDEX,
 "valid": true,
 "explanation": "+id:3955974 +message:welcome-doesnotmatchanything"
  }
   ]
}


See:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-validate.html#search-validate

I hope that those help you out.

Regards,
Jun


2014-11-07 9:47 GMT+09:00 Dave Reed :

> I have a document with a field "message", that contains the following text
> (truncated):
>
> Welcome to test.com!
>
> The assertion field is mapped to have an analyzer that breaks that string
> into the following tokens:
>
> welcome
> to
> test
> com
>
> But, when I search with a query like this:
>
> {
>   "query": {
>
> "query_string": {
>   "query": "id:3955974 AND message:welcome-doesnotmatchanything"
> }
>   }
> }
>
>
>
> To my surprise, it finds the document (3955974 is the document id). The
> dash and everything after it seems to be ignored, because it does not
> matter what I put there, it will still match the document.
>
> I've tried escaping it:
>
> {
>   "query": {
> "query_string": {
>   "query": "id:3955974 AND message:welcome\\-doesnotmatchanything"
> }
>   }
> }
> (note the double escape since it has to be escaped for the JSON too)
>
> But that makes no difference. I still get 1 matching document. If I put it
> in quotes it works:
>
> {
>   "query": {
> "query_string": {
>   "query": "id:3955974 AND message:\"welcome-doesnotmatchanything\""
> }
>   }
> }
>
> It works, meaning it matches 0 documents, since that document does not
> contain the "doesnotmatchanything" token. That's great, but I don't
> understand why the unquoted version does not work. This query is being
> generated so I can't easily just decide to start quoting it, and I can't
> always do that anyway since the user is sometimes going to use wildcards,
> which can't be quoted if I want them to function. I was under the
> assumption that an EscapedUnquotedString is the same as a quoted unespaced
> string (in other words, foo:a\b\c === foo:"abc", assuming all special
> characters are escaped in the unquoted version).
>
> I'm only on ES 1.01, but I don't see anything new or changes that would
> have impacted this behavior in later versions.
>
> Any insights would be helpful! :)
>
>
>
>
>  --
> 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/1dbfa1d5-7301-460b-ae9c-3665cfa79c96%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/1dbfa1d5-7301-460b-ae9c-3665cfa79c96%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5zFTiEcT%3D0m%3D-N0ApbfAUBqgMp2hjvmGSJaL1ByLMAAvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: couchdb and elasticsearch problem.. (dynamic false)

2014-11-03 Thread Jun Ohtani
Hi,

You have two options.

1. Create index before inserting the data
You create index before registering _river meta data.
  1. create index with mappings
  2. register _river meta

2. Use Index templates
Elasticsearch provide Index templates that allow to define templates that will 
automatically be applied to new indices created.

See: 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html



Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

> 2014/11/04 11:29、박재혁  のメール:
> 
> sorry, I can't write English.
> 
> 1. couchdb 2 document...
> 
> {
> _id : "28f69ecd54ff0b85b4aca93183001984"
> _rev: "1-7679a3bc485b5cf37473d106c302b9cc"
> _name: ""
> _price: 100
> }
> 
> {
> _id : "28f69ecd54ff0b85b4aca93183001984"
> _rev: "1-7679a3bc485b5cf37473d106c302b9cc"
> _name: ""
> }
> 
> 
> 
> 2, river  
> 
> curl -XPUT "http://localhost:9200/_river/my_couchdb_idx/_meta"; -d "{
>   "type" : "couchdb",
>   "couchdb" : {
>   "host" : "192.168.0.29",
>   "port" : 5984,
>   "db" : "my_couchdb",
>   "last_seq": "2000",
>   "filter" : null
>   }
>   }",
>   my_couchdb":{
>   "mapping":{
>   "my_couchdb":{
>   "dynamic":"false",
>   "properties":{
>   "name":{"type":"string"}
> }"
> 
> 
> 
> 
> 
> 3.  curl localhost:9200/my_couchdb/_mapping
>   => { }
>  insert new data
>   curl localhost:9200/my_couchdb/_mapping
>   => {
>   "my_kangcom" : {
> "mappings" : {
>   "my_kangcom" : {
> "properties" : {
>   "_rev" : {
> "type" : "string"
>   },
>   "name" : {
> "type" : "string"
>   },
>   "price" : {
> "type" : "long"
>   }
> }
>   }
> }
>   }
> }
> 
> 
> How to custom mapping...
> 
> help me...  
> 
> 
> 
> 
> 
> -- 
> 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/79d76e8e-8c1e-4964-8d34-87e373bb9158%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/E740F60B-A603-4FA4-91D0-BABAAF317023%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: cant check icu_tokenizer

2014-11-03 Thread Jun Ohtani
Hi Alexander,

You should use the plugin version 2.3.0 instead of 2.4.0, if yo use
elasticsearch 1.3.x.

https://github.com/elasticsearch/elasticsearch-analysis-icu
2014/11/03 22:25 "Alexander Dorogikh" :

> Salutations
>
> here is examples
>
> http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/icu-tokenizer.html
>
> $ curl -XGET http://127.0.0.1:9200
> {
>   "status" : 200,
>   "name" : "Victor Creed",
>   "version" : {
> "number" : "1.3.4",
> "build_hash" : "a70f3ccb52200f8f2c87e9c370c6597448eb3e45",
> "build_timestamp" : "2014-09-30T09:07:17Z",
> "build_snapshot" : false,
> "lucene_version" : "4.9"
>   },
>   "tagline" : "You Know, for Search"
> }
>
>
>
> $bin/plugin -install elasticsearch/elasticsearch-analysis-icu/2.4.0
>
>
>
> [alex@localhost ~]$ /usr/share/elasticsearch/bin/plugin -l
> Installed plugins:
> - langdetect
> - analysis-morphology
> - analysis-icu
>
> and test
>
> $ curl -XGET '
> http://127.0.0.1:9200/_analyze?tokenizer=icu_tokenizer&pretty=true' -d
> 'สวัสดี ผมมาจากกรุงเทพฯ'
> {
>   "error" : "ElasticsearchIllegalArgumentException[failed to find global
> tokenizer under [icu_tokenizer]]",
>   "status" : 400
> }
>
> Please help, What I am doing wrong ?
>
> thanks
>
> --
> 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/8d3d4059-477a-4bfc-9f8e-cddcf3b285d7%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/CAPW8A5y8RdFCDJr2JbFt%3DRQGeZPoUH17S9X5ez8xDn5%2BLJ%3DWBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Tribe node setup, /_cat/nodes unresponsive

2014-10-27 Thread Jun
Hi all,

I have a tribe node setup across two clusters, on server0 ($IP0) and 
server1 ($IP1), using unicast discovery.
server0 also runs the elasticsearch tribe node instance.

This setup works fine most of the time, and I can see logs from all 
clusters on tribe node Kibana.

The issue is that sometimes the elasticsearch instances go unresponsive.
More specifically, it's the nodes API (including /_cat/nodes) that do not 
respond, which results in Kibana throwing the following error message:

Could not reach http://.../_nodes. If you are using a proxy, ensure it is 
> configured correctly


At first, I thought it was just the tribe node that was doing this, but 
just today I noticed this on one of the clusters as well.
Other URLs don't seem to be affected (e.g. /, /_cluster/health, etc).

After some time, the nodes API comes back and produces the following 
output, and goes unresponsive again.
I've also tried restarting the elasticsearch processes. While it fixes the 
unresponsiveness in the short term, it then goes back to the same cycle.


jun@server0 ~ % curl -XGET "$IP0:9201/_cat/nodes?pretty=true&v=true"
hostip   heap.percent ram.percent load node.role master name
server0 $IP0   11   5 2.97 c x 
 tribe
server1 $IP1   16  38 2.74 d x 
 s1-elasticsearch
server0 $IP0   17   5 2.97 d x 
 s0-elasticsearch
server1 $IP1   c x 
 s1-logstash
server0 $IP0   c x 
 tribe
server0 $IP0   c x 
 tribe
server0 $IP0   c x 
 tribe
server0 $IP0   c x 
 s0-logstash
jun@server0 ~ % curl -XGET "$IP0:9200/_cat/nodes?pretty=true&v=true"
{
  "error" : "NullPointerException[null]",
  "status" : 500
}
jun@server0 ~ % curl -XGET "$IP1:9200/_cat/nodes?pretty=true&v=true"
{
  "error" : "NullPointerException[null]",
  "status" : 500
}
jun@server0 ~ % curl -XGET '$IP0:9201/_nodes/process?pretty=true&v=true'
{
  "cluster_name" : "elasticsearch",
  "nodes" : {
"gPX5VOT5TdGPOF6wq9ErKA" : {
  "name" : "tribe",
  "transport_address" : "inet[/$IP0:9300]",
  "host" : "server0",
  "ip" : "$IP0",
  "version" : "1.3.4",
  "build" : "a70f3cc",
  "http_address" : "inet[/$IP0:9201]",
  "attributes" : {
"client" : "true",
"data" : "false"
  },
  "process" : {
"refresh_interval_in_millis" : 1000,
"id" : 187050,
"max_file_descriptors" : 65535,
"mlockall" : false
  }
},
"liMvaS8cSu2PafCM653LHA" : {
  "name" : "s1-elasticsearch",
  "transport_address" : "inet[/$IP1:9301]",
  "host" : "server1",
  "ip" : "$IP1",
  "version" : "1.3.4",
  "build" : "a70f3cc",
  "http_address" : "inet[/$IP1:9200]",
  "process" : {
"refresh_interval_in_millis" : 1000,
"id" : 32465,
"max_file_descriptors" : 65535,
"mlockall" : false
  }
},
"z-GOP2v7Q7-FvlaS8bIBJQ" : {
  "name" : "s0-elasticsearch",
  "transport_address" : "inet[/$IP0:9301]",
  "host" : "server0",
  "ip" : "$IP0",
  "version" : "1.3.4",
  "build" : "a70f3cc",
  "http_address" : "inet[/$IP0:9200]",
  "process" : {
"refresh_interval_in_millis" : 1000,
"id" : 165512,
"max_file_descriptors" : 65535,
"mlockall" : false
  }
}
  }
}


Any help would be greatly appreciated.

Thanks,
Jun

-- 
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/314fd788-a883-45c6-9c94-226dd29f9d5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: using a different analyzer for each query and same index

2014-10-14 Thread Jun Ohtani
Hi,

I think this page is useful for you.
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/language-pitfalls.html


2014-10-12 0:39 GMT+09:00 Aris Alexis :

> bump
>
> On Wednesday, October 8, 2014 4:16:42 PM UTC+2, Aris Alexis wrote:
>>
>> Hi,
>>
>> first of all I am a noob with elastic so bear with me.
>>
>> I am interested to know if this scenario is possible:
>>
>> A user posts some text , my app detects the language and index the text
>> with the spanish analyzer for example.
>> B user posts some text in english, my app detects it and indexex the text
>> with the english analyzer *in the same field*.
>>
>> The search query also specifies the analyzer.
>>
>> Is this possible or do I need a field for every language? that's not a
>> very elegant solution.
>>
>> some other idea?
>>
>> thanks
>>
>>  --
> 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/080acb42-a86c-4072-a0ee-f42ee44eef4a%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/080acb42-a86c-4072-a0ee-f42ee44eef4a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5yZJJFGtvD8_HEQ5PmScd_701gne-A%2BcwHnenc21t1Ofg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why all replicas are unassigned?

2014-09-10 Thread Jun Ohtani
nd when create index, all replicas
>>>>>>> are unassigned.
>>>>>>>
>>>>>>> {
>>>>>>>   "cluster_name" : "elasticsearch_log",
>>>>>>>   "status" : "yellow",
>>>>>>>   "timed_out" : false,
>>>>>>>   "number_of_nodes" : 4,
>>>>>>>   "number_of_data_nodes" : 4,
>>>>>>>   "active_primary_shards" : 22,
>>>>>>>   "active_shards" : 22,
>>>>>>>   "relocating_shards" : 0,
>>>>>>>   "initializing_shards" : 0,
>>>>>>>   "unassigned_shards" : 22
>>>>>>> }
>>>>>>>
>>>>>>> How can I do?
>>>>>>>
>>>>>>  --
>>>>> 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/to
>>>>> pic/elasticsearch/kn3UHQgQKJk/unsubscribe.
>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>> elasticsearc...@googlegroups.com.
>>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>>> msgid/elasticsearch/8a7a7fcc-9a93-4ae8-9b26-8cdd9715eb7b%40goo
>>>>> glegroups.com
>>>>> <https://groups.google.com/d/msgid/elasticsearch/8a7a7fcc-9a93-4ae8-9b26-8cdd9715eb7b%40googlegroups.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 a topic in the
>>> Google Groups "elasticsearch" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/
>>> topic/elasticsearch/kn3UHQgQKJk/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> elasticsearc...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/elasticsearch/f20b0c5a-00c9-42cb-94b7-5ecb59f83904%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/elasticsearch/f20b0c5a-00c9-42cb-94b7-5ecb59f83904%40googlegroups.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/daa31c18-a809-40be-a202-53561bdd9ea0%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/daa31c18-a809-40be-a202-53561bdd9ea0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5waC%3D3kG2GXW7RTPAJ-x-TFBwvMs9iiXxSV2JuxMYJnnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to use my customer lucene analyzer(tokenizer)?

2014-08-21 Thread Jun Ohtani
Hi Art,

I wrote an example specifying the kuromoji analyzer("kuromoji") and custom
analyzer("my_analyzer") for a field.

curl -XPUT "http://localhost:9200/kuromoji-sample"; -d'
{
  "settings": {
"index": {
  "analysis": {
"analyzer": {
  "my_analyzer": {
"tokenizer": "kuromoji_tokenizer",
"filter": [
  "kuromoji_baseform"
]
  }
}
  }
}
  },
  "mappings": {
"sample": {
  "properties": {
"title": {
  "type": "string",
  "analyzer": "my_analyzer"
},
"body" : {
  "type": "string",
  "analyzer": "kuromoji"
}
  }
}
  }
}'

I hope that it will be helpful for you.


2014-08-22 9:18 GMT+09:00 :

> I have the same question about using an analyzer I have written as a
> plug-in for ElasticSearch 1.3.
>
>
> https://github.com/elasticsearch/elasticsearch-analysis-kuromoji/blob/es-1.3/README.md
> demonstrates only how to use the tokenizers in combination with the
> built-in CustomAnalyzer. They do not show how to use the kuromoji analyzer
> itself.
>
> When I try to specify my analyzer for a field, I get errors like this:
>
> MapperParsingException[Analyzer [special_analyzer] not found for field
> [foo]];
>
> Can you show an example of how to specify the kuromoji analyzer for a
> field?  I should then be able to adapt it for use with my plugin analyzer.
>
> Thanks in advance,
> Art
>
>
>
> On Tuesday, August 5, 2014 12:34:42 AM UTC-7, Jun Ohtani wrote:
>
>> Hi,
>>
>> I think this plugin will be helpful for you.
>>
>> https://github.com/elasticsearch/elasticsearch-analysis-kuromoji
>> 2014/08/05 15:58 :
>>
>>> I want to use my own Chinese analyzer and I can write lucene analyzer
>>> class myself. How can I integrate it to elasticsearch?
>>> I googled and found http://www.elasticsearch.org/guide/en/
>>> elasticsearch/guide/current/custom-analyzers.html. But it only combine
>>> existing tokenizers and filters. I can use tokenizer writing in java by
>>> myself.
>>>
>>> --
>>> 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 elasticsearc...@googlegroups.com.
>>>
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/elasticsearch/c3fe52cd-8cb5-4c53-b0fe-87183deb45bf%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/elasticsearch/c3fe52cd-8cb5-4c53-b0fe-87183deb45bf%40googlegroups.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/da795847-3ea2-4afb-9a7b-aefdd6f111a0%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/da795847-3ea2-4afb-9a7b-aefdd6f111a0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5x9xr_4OoHeBjCO%2BYYJHN3-O5pSk2fB7-v0rETKPMRHkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: A fresh variant of MapperParsingException

2014-08-12 Thread Jun Ohtani
hi,

you should not remove "core".
please try to add that.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html

2014年8月12日火曜日、Jack Parkさんは書きました:

> I created a gist for the mappings I am sending through node-es, with a
> returned error:
> MapperParsingException[Root type mapping not empty after parsing!
>
> The gist is at
> https://gist.github.com/KnowledgeGarden/b965b7e78f19f9be9025
>
> Note, that if I remove the upper portion of the json:
> "topics": {
> "mappings": {
> "core": {
> and just send in from "properties":, the same error occurs.
>
> The exact code which sends mappings into node-es is found here:
> https://github.com/KnowledgeGarden/TQTopicMap/blob/master/lib/persist/es.js
>
> I'm wondering if anyone recognizes an error in my mapping. I
> deliberately include the index and type in the mapping. It seems hard
> to find examples of schema mappings that do what I am trying to do.
>
> Thanks!
>
> Here is the error message:
> ESClient-1 Error: {"error":"MapperParsingException[mapping [topics]];
> nested: Ma
> pperParsingException[Root type mapping not empty after parsing! Remaining
> fields
> : [mappings : {core={properties={inOf={index=not_analyzed, store=true,
> type=stri
> ng}, _ver={index=not_analyzed, store=true, type=string},
> tpC={index=not_analyzed
> , store=true, type=long}, lox={index=not_analyzed, store=true,
> type=string}, srt
> Dt={index=not_analyzed, store=true, type=long}, url={index=not_analyzed,
> store=t
> rue, type=string}, lists={properties={body={index=analyzed, store=true,
> type=str
> ing}, sbOf={index=not_analyzed, store=true, type=string},
> details={index=analyze
> d, store=true, type=string}, psi={index=not_analyzed, store=true,
> type=string},
> label={index=analyzed, store=true, type=string}, subj={index=analyzed,
> store=tru
> e, type=string}}]]; ","status":400}
>
> --
> 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/CAH6s0fxkx%3D0ZpDM-qAEi4RREKKVubUcX%3DVSPSz5mwGTxYuWNNw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5zBLQNyrwX0HZwc6CECYV6H%3DqHUS5aKuy%2BCouO6b%2B9EtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Group by field and then sum the groups

2014-08-06 Thread Jun Ohtani
Hi,

I think second "aggs" use "sum" instead of "terms", in "likes_sum".


2014-08-06 14:32 GMT+09:00 Tihomir Lichev :

> You can use aggregations:
> {
>  "aggs": {
>"user_likes": {
>  "terms": {
>"field": "user_id"
>  },
>  "aggs": {
>"likes_sum": {
>  "terms": {
>"field": "likes"
>  }
>}
>  }
>}
>  }
> }
>
>
> 05 август 2014, вторник, 23:11:59 UTC+3, Cameron Barker написа:
>
>> Hi all,
>>
>> I have an elastic database of posts, each post has a *user_id* and has
>> *likes* field.  My goal is to output for a query how many likes in total
>> each user has.
>>
>> I wondered if any one had any advice/direction I could take to achieve
>> this?
>>
>> input:
>> {user_id: 10, likes: 20}
>> {user_id: 9, likes: 10}
>> {user_id: 10, likes: 25}
>> {user_id: 9, likes: 15}
>>
>> output:
>> User: 10 likes: 45
>> User: 9 likes: 25
>>
>>  --
> 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/7bec5f9a-16cf-4723-87a6-7e95de45d0ea%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/7bec5f9a-16cf-4723-87a6-7e95de45d0ea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5zuHq6a-SF7N0zCtgPQmTSFhkcgzqOFT2vodukm3uf70A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to use my customer lucene analyzer(tokenizer)?

2014-08-05 Thread Jun Ohtani
Hi,

I think this plugin will be helpful for you.

https://github.com/elasticsearch/elasticsearch-analysis-kuromoji
2014/08/05 15:58 :

> I want to use my own Chinese analyzer and I can write lucene analyzer
> class myself. How can I integrate it to elasticsearch?
> I googled and found
> http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-analyzers.html.
> But it only combine existing tokenizers and filters. I can use tokenizer
> writing in java by myself.
>
> --
> 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/c3fe52cd-8cb5-4c53-b0fe-87183deb45bf%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/CAPW8A5xqnsWa76TJuSAWwxPyrUA8F9cJ6tyTs2ZJxXFpb4vEMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: XGET to _mapping does not match the mapping I used to create the index, is this normal?

2014-06-08 Thread Jun Ohtani
Hi,

You’re welcome.

Btw Twitterとかで聞いてもらっても答えますので、お気軽に。もちろん、MLのほうが皆さんに見えるのでいいのですが。


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

2014/06/07 0:17、Enno Shioji  のメール:

> Hi Jun,
> 
> Ah, I must be doing something wrong then. I'll correct the JSON and test 
> again.
> 
> Btw わざわざテストしていただきありがとうございます!
> 
> 
> 
> On Friday, 6 June 2014 15:29:37 UTC+1, Jun Ohtani wrote:
> Hi, 
> 
> How do you use API to create index? 
> 
> I think “dynamic” property is wrong place. 
> 
> I try to create index to use the following JSON and index; 
> 
> curl -XPOST localhost:9200/myidx -d ' 
> { 
>   "settings": { 
> "index.refresh_interval": "5m" 
>   }, 
>   "mappings": { 
> "message": { 
>   "dynamic": "strict", 
>   "_ttl": { 
> "enabled": true 
>   }, 
>   "properties": { 
> "my_nested_thing": { 
>   "type": "nested", 
>   "properties": { 
> "some_id": { 
>   "type": "string", 
>   "index": "not_analyzed" 
> }, 
> "count": { 
>   "type": "long" 
> } 
>   } 
> } 
>   } 
> } 
>   } 
> }' 
> 
> curl -XGET localhost:9200/myidx/_mapping?pretty 
> 
> { 
>   "myidx" : { 
> "mappings" : { 
>   "message" : { 
> "dynamic" : "strict", 
> "_ttl" : { 
>   "enabled" : true 
>     }, 
> "properties" : { 
>   "my_nested_thing" : { 
> "type" : "nested", 
> "properties" : { 
>   "count" : { 
> "type" : "long" 
>   }, 
>   "some_id" : { 
> "type" : "string", 
> "index" : "not_analyzed" 
>   } 
> } 
>   } 
> } 
>   } 
> } 
>   } 
> } 
> 
> Does it make sense? 
> 
>  
> Jun Ohtani 
> joh...@gmail.com 
> blog : http://blog.johtani.info 
> twitter : http://twitter.com/johtani 
> 
> 2014/06/06 22:31、Enno Shioji  のメール: 
> 
> > Hi, I created my index using this mapping JSON: 
> > 
> > { 
> > "myidx": { 
> > "index.refresh_interval":"5m", 
> > "mappings": { 
> > "dynamic": "strict", 
> > "message": { 
> > "_ttl": { 
> > "enabled": true 
> > }, 
> > "properties": { 
> > "my_nested_thing": { 
> > "type": "nested", 
> > "properties": { 
> > "some_id": { 
> > "type": "string", "index": "not_analyzed" 
> > }, 
> > "count": { 
> > "type": "long" 
> > }, 
> > } 
> > } 
> > } 
> > } 
> > } 
> > } 
> > } 
> > 
> > If I do a GET to _mapping after indexing some documents, it will 
> > essentially return: 
> > 
> > { 
> > "message": { 
> > "properties": { 
> > "my_nested_thing": { 
> > "properties": { 
> > "some_id": { 
> > "type": "string", "index": "not_analyzed" 
> > }, 
> > "count": { 
> > "type": "long" 
> > }, 
> > } 
> > } 
> > } 
> > } 
> > } 
> > 
>

Re: XGET to _mapping does not match the mapping I used to create the index, is this normal?

2014-06-06 Thread Jun Ohtani
Hi,

How do you use API to create index?

I think “dynamic” property is wrong place.

I try to create index to use the following JSON and index;

curl -XPOST localhost:9200/myidx -d '
{
  "settings": {
"index.refresh_interval": "5m"
  },
  "mappings": {
"message": {
  "dynamic": "strict",
  "_ttl": {
"enabled": true
  },
  "properties": {
"my_nested_thing": {
  "type": "nested",
  "properties": {
"some_id": {
  "type": "string",
  "index": "not_analyzed"
},
"count": {
  "type": "long"
}
  }
}
  }
}
  }
}'

curl -XGET localhost:9200/myidx/_mapping?pretty

{
  "myidx" : {
"mappings" : {
  "message" : {
"dynamic" : "strict",
"_ttl" : {
  "enabled" : true
},
"properties" : {
  "my_nested_thing" : {
"type" : "nested",
"properties" : {
  "count" : {
"type" : "long"
  },
  "some_id" : {
"type" : "string",
"index" : "not_analyzed"
  }
}
  }
}
  }
}
  }
}

Does it make sense?


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

2014/06/06 22:31、Enno Shioji  のメール:

> Hi, I created my index using this mapping JSON:
> 
> {
> "myidx": {
> "index.refresh_interval":"5m",
> "mappings": {
> "dynamic": "strict",
> "message": {
> "_ttl": {
> "enabled": true
> },
> "properties": {
> "my_nested_thing": {
> "type": "nested",
> "properties": {
> "some_id": {
> "type": "string", "index": "not_analyzed"
> },
> "count": {
> "type": "long"
> },
> }
> }
> }
> }
> }
> }
> }
> 
> If I do a GET to _mapping after indexing some documents, it will essentially 
> return:
> 
> {
> "message": {
> "properties": {
> "my_nested_thing": {
> "properties": {
> "some_id": {
> "type": "string", "index": "not_analyzed"
> },
> "count": {
> "type": "long"
> },
> }
> }
> }
> }
> }
> 
> I.e. "_ttl": enabled=true and the "type": "nested" is not present from the 
> mapping. I also noticed that it allows auto update to the mapping despite the 
> "dynamic": "strict" instruction.
> 
> Does this mean these instructions are somehow not being reflected? If so, 
> what am I doing wrong?
> 
> I'm using version 1.2.1
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 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/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: percolator does not support min_score?

2014-06-03 Thread Jun Ohtani
Hi,

I’m not sure how to implement the percolator, 
but I think that min_score does not work properly.
Because the percolator is processing one document at a time, 
it is different from the usual score.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html#_important_notes

Why do you want to use the min_score?


Jun Ohtani
joht...@gmail.com
twitter : http://twitter.com/johtani

2014/06/04 12:20、Miyuki Endo  のメール:

> Hi!  I'm running the following percolator to test out one of the use cases:
> 
> Elasticsearch version 1.1.1
> 
> ---PUT Percolator
> curl -XPUT 'localhost:9200/shop/.percolator/p-1' -d @percolator1.json
> 
> ---percolator1.json
> {
>   "min_score":0.8,
>   "query":{
> "filtered":{
>   "query":{
> "match":{
>   "casts":"Johnny Anne"
> }
>   },
>   "filter":{
> "range":{
>   "year":{
> "gte":2005
>   }
> }
>   }
> }
>   }
> }
> 
> ---PUT Document
> curl -XPUT 'localhost:9200/shop/dvd/0' -d '{
>   "title":"Alice in Wonderland",
>   "year":2010,
>   "director":"Tim Burton",
>   "writer":["Linda Woolverton","Lewis Carroll"],
>   "casts":["Johnny Depp","Mia Wasikowska","Anne Hathaway"],
>   "time":109,
>   "available":true,
>   "tags":["Family","Fantasy","Adventure"]
> }'
> 
> ---Get Document (standard query : same ".percolator/p-1")
> curl -XGET 'localhost:9200/shop_ja/dvd/_search?pretty' -d '
> {
>   "min_score":0.8,
>   "query":{
> "filtered":{
>   "query":{
> "match":{
>   "casts":"Johnny Anne"
> }
>   },
>   "filter":{
> "range":{
>   "year":{
> "gte":2005
>   }
> }
>   }
> }
>   }
> }'
> => No hit
> 
> * When "min_score" is 0.7, it hits as expected. 
> 
> --- Get _percolate
> curl -XGET 'localhost:9200/shop_ja/dvd/0/_percolate'
> => ..."total":1,"matches":[{"_index":"shop","_id":"p-1"}]
> 
> It seems that there is no effect of min_score. 
> percolator does not support min_score?
> 
> 
> -- 
> 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/2325e125-77b5-43b4-bfc8-ec2ca71704cd%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Highlighting fields of stored nested document with _source disabled

2014-03-13 Thread Jun Ohtani
Hi,

I had similar situation and I created the following issue.

https://github.com/elasticsearch/elasticsearch/issues/5245

And this issue is already closed.
Unfortunately, this behavior is the limitation of nested object currently.

I hope this will answer your needs.

Regards,
Jun


2014-02-20 1:59 GMT+09:00 Angel Cross :

> Hi all.
> I'm experiencing problems trying to highlight fields of nested document.
> The parent document has its _source disabled (enabled : false).
> Nested document and its fields has store option set to yes. And I'm trying
> to query and highlight it with the following request
> {
>   "query": {
> "query_string": {
>   "query": "red"
> }
>   },
>   "highlight": {
> "fields": {
>   "Metadata.Category": {}
> }
>   }
> }
>
> If _source is enabled this request works just fine. But if I disable
> source and change mapping to include store option for nested document this
> doesn't work(the document is found but not highlighted).
>
> Here is a part of my mapping
> {
>...
> "_source" :{"enabled" :false},
> properties: {
>...
> "Name": {
> "type": "multi_field", store : "yes",
> "fields": {
> "Name": { "type": "string",store : "yes", "analyzer":
> "en_analyzer" },
> "_Name": { "type": "string",store : "yes", "index":
> "not_analyzed" }
> }
> }
>   ...
>
>   Metadata: {
> store :"yes",
> type: "nested",
> properties: {
>
> "Text": {
> "type": "multi_field",  store :"yes",
> "fields": {
> "Text": {"type": "string", store :"yes",
> "analyzer": "en_analyzer" },
> "_Text": { "type": "string",store :"yes",
> "index": "not_analyzed" }
> }
> },
> "Category": {
> "type": "multi_field",  store :"yes",
> "fields": {
> "Category": {"type": "string", store :"yes" ,
> "analyzer": "en_analyzer" },
> "_Category": { "type": "string", store :"yes",
> "index": "not_analyzed" }
> }
> }
> ...
> }
>
> }
>
> .
> }
> };
>
> When I do the same to the field Name that is not in nested document it
> works just fine.
>
> Could anybody please tell me what am I doing wrong, and is it possible to
> highlight stored field of nested document?
>
> Thanks
>
> --
> 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/ceac9780-bf60-42d8-9cab-4bcf6dffb393%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5zG00RwzTj6nQVopTybynrNNYsORPfFgq_DyNrtE6dmGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question : Field behavior in Nested object

2014-02-24 Thread Jun Ohtani
Thanks for replying.

I open a ticket.
https://github.com/elasticsearch/elasticsearch/issues/5245



2014-02-25 8:34 GMT+09:00 Binh Ly :

> It does look like a bug. Can you please open a ticket/issue? 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/3ab3b9de-05ae-4b5b-be36-2993d85ba9fc%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5yd-SqitmZt-O8%3DOE2QnbgE-TJXGZ0ZZe%2BGk%2BthSdqdPg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Question : Field behavior in Nested object

2014-02-24 Thread Jun Ohtani
Hi all,

I am using the nested object.
There is strange behavior of field in nested object.

All sample mapping and data : https://gist.github.com/johtani/9183848

1. _source store
2. book.title is not stored
3. book.contents is stored

If fields parameter specify “book.title” and “book.contents”, I get only 
“book.title”.
This data is returned from _source.

Why did not return “book.contents”?
Should I use _source instead of store=“true" ?

Regards,
Jun

----
Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Count of Words (Text Based Search) Using Facets

2014-02-13 Thread Jun Ohtani
Hi,

I update gist adding TermFreqQuerySample.java.

https://gist.github.com/johtani/8818938#file-termfreqquerysample

I hope this helps.

Regards,


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

2014/02/13 21:17、Hiro Gangwani  のメール:

> Hi,
> Can we get the corresponding code using Java API. We are using 
> QueryBuilders.fieldQuery method for searching the test from files.
> 
> That will help.
> 
> Thanks,
> 
> Hiro
> 
> On Tuesday, 28 January 2014 12:24:05 UTC+5:30, Hiro Gangwani wrote:
> Hi,
> We are indexing PDF, Word document in ES using attachment as type. Text based 
> search is implemented using QueryBuilder and field query.Is it possible to 
> get the count of words as defined in the search criteria for each results 
> returned.
> 
> For example:
> Document A contain Java key word 50 times and Document B contains Java key 
> word 30 times.
> When search criteria is "Java" and text based search is executed we get 2 
> documents in search results.
> Is it possible to get count of Java in document A and document B?
> I have used Term facets which just given count of documents where Java text 
> is defined. In this case only 2. What we need is count of Java word in each 
> document returned in result.
> 
> We are stuck up with this requirement and unable to find the solution for 
> this. Any help for this issue is appreciated and thanks in advance.
> 
> Hiro
> 
> -- 
> 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/47d12008-3ba9-438e-9c3d-4b1c01a18e55%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Terms Aggregrations: size=0 does not work (V1.0.RC2)

2014-02-06 Thread Jun S. Kang
Hi All, 


I am testing the aggregations and it seems like setting size=0 in "terms 
aggregations" is not working as it should be. 
(Unless it is "added at 1.1.0" as it is noted on this document. 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-aggregations-bucket-terms-aggregation.html
 )


I constructed my query as below, expecting it to return *all buckets*.
{
   "aggs": {
  "action_result_identity": {
 "terms": {
"script": "doc['action'].value+'_'+doc['result'].value",
"size": 0
 }
  }
   }
}

But, instead, I got response as below:

{
   "took": 1060,
   "timed_out": false,
   "_shards": {
  "total": 4,
  "successful": 4,
  "failed": 0
   },
   "hits": {
  "total": *143665*,
  "max_score": 1,
  "hits": [...]
   },
*   "aggregations": {*
*  "action_result": {*
* "buckets": []*
*  }*
*   }*
}



If I set the "size" value as "143665" which is the safely large number (# 
of all documents), then ES responses with 10s of buckets. 

Is this a bug or am I doing something wrong here?





-- 
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/168ce7d3-4945-4a07-92b2-f4731b767897%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Count of Words (Text Based Search) Using Facets

2014-02-05 Thread Jun Ohtani
Hi Jayesh,

Term statistics is available 0.90.10 or higher.

See:
http://www.elasticsearch.org/downloads/0-90-10/


2014-02-05 Jun Ohtani :

> Hi Jayesh,
>
> Umm, what the version of es do you use?
> I use 1.0.0.RC1 and 0.90.10.
>
> Regards,
> Jun
>
>
> 2014-02-05 Jayesh Bhoyar :
>
>> Hi Jun,
>>
>>
>> I used Head plugin as well as curl command but for both the approach I am
>> getting the error :(
>>
>>
>> Regards,
>> Jayesh Bhoyar
>> http://www.linkedin.com/in/jayeshbhoyar
>>
>>  --
>> 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/d2e94324-b85e-422a-b913-e59e2fc28421%40googlegroups.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> ---
> Jun Ohtani
> blog : http://blog.johtani.info
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5xCo%3DDpspzTJXkfwFqr69aAW%2BVs9ekj7y-MNP9VOrxCwg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Count of Words (Text Based Search) Using Facets

2014-02-05 Thread Jun Ohtani
Hi Jayesh,

Umm, what the version of es do you use?
I use 1.0.0.RC1 and 0.90.10.

Regards,
Jun


2014-02-05 Jayesh Bhoyar :

> Hi Jun,
>
> I used Head plugin as well as curl command but for both the approach I am
> getting the error :(
>
>
> Regards,
> Jayesh Bhoyar
> http://www.linkedin.com/in/jayeshbhoyar
>
>  --
> 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/d2e94324-b85e-422a-b913-e59e2fc28421%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5wfzPS4eZCYi9cR-xCXaYfbL2c1kaC%3DkSuJLcGT-sENHA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Count of Words (Text Based Search) Using Facets

2014-02-05 Thread Jun Ohtani
Hi Jayesh,

Sorry, I use chrome plugin "sense" .
Do you use curl command?

You try to use the following command, if you use curl.


curl -XGET "http://localhost:9200/sample/doc_count/_search"; -d'
{
  "query": {
"query_string": {
  "default_field": "text",
  "query": "java"
}
  },
  "script_fields": {
"term_count": {
  "script": "_index[\"text\"][\"java\"].tf()"
}
  }
}'


Does it make sense?

Regards,
Jun


2014-02-05 Jayesh Bhoyar :

> Hi
>
> If I run the query that you have mentioned that I get the following error:
> Added in your thread
> https://gist.github.com/johtani/8818938/
>
> Regards,
> Jayesh Bhoyar
> http://www.linkedin.com/in/jayeshbhoyar
>
> --
> 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/7ad078ea-b2e5-450e-bc88-7a3446889a6f%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5w0K7ah32Hb1VG8H0C1EqAxZVHVyXKqJeThu-eTSZp7Pg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Count of Words (Text Based Search) Using Facets

2014-02-04 Thread Jun Ohtani
Hi Hiro,

I think you should use script term statistics.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-advanced-scripting.html#_term_statistics

I post sample json and query DSL to gist.
https://gist.github.com/johtani/8818938

Note: Term “Java” is indexed just “java”, because standard analyzer use 
lowercase_filter.
  My sample script use “java” not “Java”. 

I am hoping that it will be helpful for you.

Regards

Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

2014/01/28 15:54、Hiro Gangwani  のメール:

> Hi,
> We are indexing PDF, Word document in ES using attachment as type. Text based 
> search is implemented using QueryBuilder and field query.Is it possible to 
> get the count of words as defined in the search criteria for each results 
> returned.
> 
> For example:
> Document A contain Java key word 50 times and Document B contains Java key 
> word 30 times.
> When search criteria is "Java" and text based search is executed we get 2 
> documents in search results.
> Is it possible to get count of Java in document A and document B?
> I have used Term facets which just given count of documents where Java text 
> is defined. In this case only 2. What we need is count of Java word in each 
> document returned in result.
> 
> We are stuck up with this requirement and unable to find the solution for 
> this. Any help for this issue is appreciated and thanks in advance.
> 
> Hiro
> 
> -- 
> 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/73629eee-7b58-44d4-87b3-aeb0d18b4c03%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Please, help with elasticsearch result term.

2014-02-01 Thread Jun Ohtani
Hi,

You should use "not_analyzed" to singer and title field "index" attribute
for using the field "TOP TITLE" panel.

You delete the index before you change the mapping.
And you re-index all data.

See:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html

I am hoping that it will be helpful for you.

Regards,
Jun
2014/02/02 10:25 "Jong Min Kim" :

> Hi, I'm Jongmin from Korea.
>
> I'm using elasticsearch with kibana to analyze my music providing service.
>
> This is the type of log that indexed in elasticsearch.
>
> {"cid":"163691","singer":"Brian
> McKnight","stime":"2014-01-18T17:46:56","title":"One Last
> Cry","_index":"music","_type":"mymusic","_id":"20140120_4943395"}
>
> When I made a term panel in Kibana, and expected title records, and It
> shows this.
>
>
> <https://lh5.googleusercontent.com/-y68-46NZWN8/Uu2dJgxV5hI/AR8/qQ5PmCPdmOI/s1600/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA+2014-02-02+%E1%84%8B%E1%85%A9%E1%84%8C%E1%85%A5%E1%86%AB+10.19.12.png>
>
> It shows search result "One" "Last" "Cry" separately. I want a sentence
> "One last cry" in one result.
>
> I want to make a panel board with Top Music Titles and Top Singers.
>
> I guess I have to setup elasticsearch TokenAnalyzer, but I'm very new with
> ES and have no idea how to do it.
>
> Please someone give me the guide how can I change the setting.
>
> Thank you 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/42c3b148-450c-4d43-b247-b495f5907b8f%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/CAPW8A5wK4NjmedSWT6oK3vTKCtpqT2vTiKTYJ5Q2qbq16jA0pw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Aggregation Module - value_count problem

2014-01-31 Thread Jun Ohtani
Hi,

I think “value_count” counts the number of values, as terms, per each docs.

Your first question: Why is “k_count” 22 instead of 20?

Your example field “k” is analyzed using the standard tokenizer.
2nd doc’s “k” is “a few” and 5th doc’s “k” is “next year”.
These text is divided by standard tokenizer.
Then “value_count” counts 2 value in 2nd doc and 5th doc.
Other doc return value 1.
Finally, the aggregator aggregate value from each docs, and then return 22.

Your second question: Why is “t_count” 20 instead of 1?

The aggregator counts value, as term , from each docs.
Because of that, the aggregator return 20.

Does it make sense?


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

2014/01/25 14:06、watsinden...@gmail.com のメール:

> Hi,
> 
> I am trying to get the unique number of values for a given field. From my 
> understanding of "value_count" it counts the number of values that are 
> extracted from the aggregated documents. After the steps in 
> https://gist.github.com/shivprak/8611922#file-es-agg-test-1-sh, and on 
> querying for unique values of field "k" the response that I get is 
> 
> {
>"took": 16,
>"timed_out": false,
>"_shards": {
>   "total": 5,
>   "successful": 5,
>   "failed": 0
>},
>"hits": {
>   "total": 20,
>   "max_score": 1,
>   "hits": [] //deleted content of "hits" to shorten the paste
>},
>"aggregations": {
>   "k_count": {
>  "value": 22
>   }
>}
> }
> 
> 
> How can I be getting "value" 22, shouldn't it be 20 as thats the number of 
> unique "k" values in documents.
> 
> Another example, on querying for unique values of field "t" I get the 
> following response
> 
> {
>"took": 7,
>"timed_out": false,
>"_shards": {
>   "total": 5,
>   "successful": 5,
>   "failed": 0
>},
>"hits": {
>   "total": 20,
>   "max_score": 1,
>   "hits": [] //deleted content of "hits" to shorten the paste
>},
>"aggregations": {
>   "k_count": {
>  "value": 20
>   }
>}
> }
> 
> Again, shouldn't the "value" be 1, as the only value of "t" is 23 in all 
> documents.
> 
> -- 
> 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/92ade2ec-6998-497d-a253-5decb7a733bc%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Incorrect document about an aggregation "value_count" type?

2014-01-31 Thread Jun Ohtani
Hi,

When I read the aggregation document, I found typo in the following page.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-aggregations-metrics-valuecount-aggregation.html#_script_7

Description : ”Counting the values generated by a script:

But, I think value_count does not support script, because I don’t find “script” 
in ValueCountParser.java

https://github.com/elasticsearch/elasticsearch/blob/2df42e4460fa5f0d87363672e305c88d9f30b093/src/main/java/org/elasticsearch/search/aggregations/metrics/valuecount/ValueCountParser.java#L54

Does it make sense?


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani



signature.asc
Description: Message signed with OpenPGP using GPGMail


[ANN]Elasticsearch Extended Analyze plugin update for 1.0.0.RC1

2014-01-18 Thread Jun Ohtani
Hi,

Just released extended analyze plugin 1.0.0.RC1 for elasticsearch 1.0.0.RC1.

https://github.com/johtani/elasticsearch-extended-analyze

For more info about the plugins, see the Github pages.

Feedback, comments, issues are most welcome.

Best,
Jun 

Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Searching indexed fields without analysing

2014-01-09 Thread Jun Ohtani
Hi Brian,

Thanks!

I understand that your query does not match anything at all.

“query_string” query is changed automatically query-terms to lower-case in some 
cases.
i.e. wildcard, prefix, fuzzy…
See : 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

I change your query as follow : 

{
"query": {
   "bool" : {
"must" : {
  "query_string" : {
"query" : "text.na:Immortal-Li*",
"lowercase_expanded_terms" : false
  }
}
  }
}
}

Then returns the two documents.

I've learned a great deal!

Regards,



Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani




2014/01/10 13:07、InquiringMind  のメール:

> If it helps, here are my index settings and mappings. Note that I chose the 
> name text.na as the non-analyzed form, not text.raw. Perhaps I should follow 
> convention? But for now, a rose by any other name is still not analyzed:
> 
> {
>   "settings" : {
> "index" : {
>   "number_of_shards" : 1,
>   "refresh_interval" : "1s",
>   "analysis" : {
> "char_filter" : { },
> "filter" : {
>   "english_snowball_filter" : {
> "type" : "snowball",
> "language" : "English"
>   }
> },
> "analyzer" : {
>   "english_stemming_analyzer" : {
> "type" : "custom",
> "tokenizer" : "standard",
> "filter" : [ "standard", "lowercase", "asciifolding", 
> "english_snowball_filter" ]
>   },
>   "english_standard_analyzer" : {
> "type" : "custom",
> "tokenizer" : "standard",
> "filter" : [ "standard", "lowercase", "asciifolding" ]
>   }
> }
>   }
> }
>   },
>   "mappings" : {
> "_default_" : {
>   "dynamic" : "strict"
> },
> "ghost" : {
>   "_all" : {
> "enabled" : false
>   },
>   "_ttl" : {
> "enabled" : true,
> "default" : "1.9m"
>   },
>   "properties" : {
> "cn" : {
>   "type" : "string",
>   "analyzer" : "english_stemming_analyzer"
> },
> "text" : {
>   "type" : "multi_field",
>   "fields" : {
> "text" : {
>   "type" : "string",
>   "analyzer" : "english_stemming_analyzer",
>   "position_offset_gap" : 4
> },
> "std" : {
>   "type" : "string",
>   "analyzer" : "english_standard_analyzer",
>   "position_offset_gap" : 4
> },
> "na" : {
>   "type" : "string",
>   "index" : "not_analyzed"
> }
>   }
> }
>   }
> },
> "elf" : {
>   "_all" : {
> "enabled" : false
>   },
>   "_ttl" : {
> "enabled" : true
>   },
>   "properties" : {
> "cn" : {
>   "type" : "string",
>   "analyzer" : "english_stemming_analyzer"
> },
> "text" : {
>   "type" : "multi_field",
>   "fields" : {
> "text" : {
>   "type" : "string",
>   "analyzer" : "english_stemming_analyzer",
>   "position_offset_gap" : 4
> },
> "std" : {
>   "type" : "string",
>   "analyzer" : "english_standard_analyzer",
>   "position_offset_gap" : 4
> },
> "na" : {
>   "type" : "string",
>   "index" : "not_analyzed"
> }
>   }
> }
>   }
> }
>   }
> }
> 
> 
> Brian
> 
> On Thursday, January 9, 2014 10:38:15 PM UTC-5, Jun Ohtani wrote:
> Hi Chris, 
> 
> I recreate your issue to the following gist. 
> 
> https://gist.github.com/johtani/8346404 
> 
> And I try to change  query as follows: 
> 
> User_Name.raw:bob.smith-jones -> matches 
> User_Name.raw:bob.smi* -> matches 
> User_Name.raw:bob.smith-j* -> matches 
> User_Name.raw:bob.smith\-j* -> matches 
> 
> I use User_Name.raw field instead of User_Name. 
> 
> Sorry, not necessary to escape… 
> 
> And I don’t know why do not work Brian example’s query_string query… 
> 
> 
> 
> -- 
> 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 toelasticsearch+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elasticsearch/b0aece84-052c-4efc-8a25-1b42850fefe4%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Searching indexed fields without analysing

2014-01-09 Thread Jun Ohtani
Hi Chris,

I recreate your issue to the following gist.

https://gist.github.com/johtani/8346404

And I try to change  query as follows:

User_Name.raw:bob.smith-jones -> matches
User_Name.raw:bob.smi* -> matches
User_Name.raw:bob.smith-j* -> matches
User_Name.raw:bob.smith\-j* -> matches

I use User_Name.raw field instead of User_Name.

Sorry, not necessary to escape…

And I don’t know why do not work Brian example’s query_string query…

Does it make sense?
Is this understanding mistaken?


----
Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani




2014/01/10 2:09、InquiringMind  のメール:

> Chris,
> 
> I updated one of my tests to reproduce your issue. My text field is a 
> multi-field where text.na is the text field without any analysis at all.
> 
> This Lucene query does not find anything at all:
> 
> {
>   "bool" : {
> "must" : {
>   "query_string" : {
> "query" : "text.na:Immortal-Li*"
>   }
> }
>   }
> }
> 
> But this one works fine:
> 
> {
>   "bool" : {
> "must" : {
>   "prefix" : {
> "text.na" : {
>   "prefix" : "Immortal-Li"
> }
>   }
> }
>   }
> }
> 
> And returns the two documents that I expected:
> 
> { "_index" : "mortal" , "_type" : "elf" , "_id" : "1" , "_version" : 1 , 
> "_score" : 1.0 , "_source" :
>{ "cn" : "Celeborn" , "text" : "Immortal-Lives forever" } }
> 
> { "_index" : "mortal" , "_type" : "elf" , "_id" : "2" , "_version" : 1 , 
> "_score" : 1.0 , "_source" :
>{ "cn" : "Galadriel" , "text" : "Immortal-Lives forever" } }
> 
> Note that in both cases, the query's case must match since the field value is 
> not analyzed at all.
> 
> I'm not sure if this is a true bug. In general, I find Lucene syntax somewhat 
> useful for ad-hoc queries, and I find their so-called Simple Query Parser 
> syntax to be completely unable to find anything when there is no _all field, 
> whether or not I specify a default field. (But that's another issue I'm going 
> to ask about in the near future.)
> 
> Brian
> 
> On Thursday, January 9, 2014 8:27:04 AM UTC-5, Chris H wrote:
> Hi, Jun.
> 
> That doesn't seem to work.  For a user with the username bob.smith-jones:
>   • bob.smith-jones -> matches
>   • bob.smith- -> matches
>   • bob.smi* -> matches
>   • bob.smith-j* -> no results
>   • bob.smith\-j* -> no results
> Also, a "$" isn't one of the special characters.
> 
> Thanks.
> 
> -- 
> 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/6cb908eb-9ca7-4f05-815f-a868c45f9f66%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Searching indexed fields without analysing

2014-01-09 Thread Jun Ohtani
Hi Chris,

Could you try to escape “-“ in query for “not_analyzed” field?

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_reserved_characters

I hope this helps.
Regards,


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani




2014/01/09 17:20、Chris H  のメール:

> Hi, a bit more information.
> 
> I tried adding a custom analyzer based off a recommendation I saw online 
> somewhere.  This partly works in that it's not tokenising.  But I can't do 
> wildcard searches in Kibana on the fields, and they're now case sensitive :(
> 
> curl localhost:9200/_template/logstash-username -XPUT -d '{
> "template": "logstash-*",
> "settings" : {
> "analysis": {
> "analyzer": {
> "lc_analyzer": {
> "type": "custom",
> "tokenizer": "keyword",
> "filters": ["lowercase"]
> }
> }
> }
> },
> "mappings": {
> "_default_": {
>  "properties" : {
> "User_Name" : { "type" : "string", "analyzer" : "lc_analyzer" 
> }
> }
> }
> }
> }'
> 
> Thanks
> 
> On Wednesday, January 8, 2014 3:26:03 PM UTC, Chris H wrote:
> Hi.  I've deployed elasticsearch with logstash and kibana to take in Windows 
> logs from my OSSEC log server, following this guide: 
> http://vichargrave.com/ossec-log-management-with-elasticsearch/
> I've tweaked the logstash config to extract some specific fields from the 
> logs, such as User_Name.  I'm having some issues searching on these fields 
> though.
> 
> These searches work as expected:
>   • User_Name: * 
>   • User_Name: john.smith
>   • User_Name: john.*
>   • NOT User_Name: john.*
> But I'm having problems with Computer accounts, which take the format 
> "w-dc-01$" - they're being split on the "-" and the "$" is ignored.  So a 
> search for "w-dc-01" returns all the servers named "w-".  Also I 
> can't do "NOT User_Name: *$" to exclude computer accounts.
> 
> The mappings are created automatically by logstash, and GET 
> /logstash-2014.01.08/_mapping shows:
> 
> "User_Name": {
> 
>"type": "multi_field",
>"fields": {
>   "User_Name": {
>  "type": "string",
>  "omit_norms": true
>   },
>   "raw": {
>  "type": "string",
>  "index": "not_analyzed",
>  "omit_norms": true,
>  "index_options": "docs",
>  "include_in_all": false,
>  "ignore_above": 256
>   }
>}
> },
> My (limited) understanding is that the "not_analyzed" should stop the field 
> being split, so that my searching matches the full name, but it doesn't.  I'm 
> trying both kibana and curl to get results.
> 
> Hope this makes sense.  I really like the look of elasticsearch, but being 
> able to search on extracted fields like this is pretty key to me using it.
> 
> Thanks.
> 
> 
> 
> -- 
> 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/96e74e53-54f9-48ec-9e5c-8f1354b264be%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Order results by value in one of the array entries.

2014-01-08 Thread Jun Ohtani
Hi Johan,

Sorry for the late reply.

script base sort sample like this.

--sample--
POST /script_order_sample/_search
{
"query": {
"match": {
"product_name":{
"query":"alfa",
"type" : "phrase"
}
}
},
"filter": {
"bool": {
"must": [
   {
   "term": {
  "inventory.warehouse": "warehouse_a"
   }
   }
]
}
},
"sort": {
"_script" : {
"script" : "foreach( stock_info : _source.inventory){ if 
(stock_info.warehouse == 'warehouse_a') {return stock_info.stock;}}",
"type" : "number",
"order" : "desc"
}
}
}

—

I have another plan for this issue.
I think that “inventory” array is flatten like this.
Ant your query only specify “sort” to “warehourse_a”.

{
"product_name": "product alfa",
"product_id": "4a86c92ccd26111d7ba0eada7da6a75af",
"description": "This is a sample product",
"image_id": "product_a.jpg",
"warehouse_a”: 99,
“warehouse_b": 19,
“warehouse_c”: 99
}

I hope it helps your issue.
Regards,


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani




2014/01/08 20:11、Johan E  のメール:

> Hi Jun,
> 
> Thanks for your reply.
> 
> Im not sure how I can get that to work. In my project I need to only 
> boost/order by the stock of "warehouse_a", how do I use only the value for 
> that entry in the array?
> 
> Thanks
> Johan
> 
> On Wednesday, January 8, 2014 4:35:50 AM UTC, Jun Ohtani wrote:
> Hi Johan, 
> 
> You try to use script based sorting. 
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_script_based_sorting
>  
> 
> Or the function score query. 
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_script_score
>  
> 
> I hope this helps. 
> 
> Regards, 
> 
>  
> Jun Ohtani 
> joh...@gmail.com 
> blog : http://blog.johtani.info 
> twitter : http://twitter.com/johtani 
> 
> 
> 
> 
> 2014/01/07 19:45、Johan E  のメール: 
> 
> > Hi, 
> > 
> > I'm trying to order the result of a query by a specified entry in a array. 
> > 
> > Here is a sample entry 
> > 
> > 
> > { 
> > "product_name": "product alfa", 
> > "product_id": "4a86c92ccd26111d7ba0eada7da6a75af", 
> > "description": "This is a sample product", 
> > "image_id": "product_a.jpg", 
> > "inventory": [ 
> > { 
> > "warehouse": "warehouse_a", 
> > "stock": 99 
> > }, 
> > { 
> > "warehouse": "warehouse_b", 
> > "stock": 19 
> > }, 
> > { 
> > "warehouse": "warehouse_c", 
> > "stock": 99 
> > } 
> > ] 
> > } 
> > 
> > If there were more "products" containing alfa, I would (for example) want 
> > to sort they by the stock of a warehouse. 
> > 
> > I'm currently using a query like: 
> > 
> > POST _search 
> > { 
> > "query": { 
> > "match": { 
> > "product_name":{ 
> > "query":"alfa", 
> > "type" : "phrase" 
> > } 
> > } 
> > }, 
> > "filter": { 
> > "bool": { 
> > "must": [ 
> >{ 
> >"term": { 
> >   "availability.warehouse": "warehouse_a" 
> >} 
> >} 
> > ] 
> > } 
> > } 
> > } 
> > 
&g

Re: Order results by value in one of the array entries.

2014-01-07 Thread Jun Ohtani
Hi Johan,

You try to use script based sorting.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_script_based_sorting

Or the function score query.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_script_score

I hope this helps.

Regards,


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani




2014/01/07 19:45、Johan E  のメール:

> Hi,
> 
> I'm trying to order the result of a query by a specified entry in a array.
> 
> Here is a sample entry
> 
> 
> {
> "product_name": "product alfa",
> "product_id": "4a86c92ccd26111d7ba0eada7da6a75af",
> "description": "This is a sample product",
> "image_id": "product_a.jpg",
> "inventory": [
> {
> "warehouse": "warehouse_a",
>   "stock": 99
> },
> {
> "warehouse": "warehouse_b",
>   "stock": 19
> },
> {
> "warehouse": "warehouse_c",
>   "stock": 99
> }
>   ]
> }
> 
> If there were more "products" containing alfa, I would (for example) want to 
> sort they by the stock of a warehouse.
> 
> I'm currently using a query like:
> 
> POST _search
> {
> "query": {
> "match": {
> "product_name":{
> "query":"alfa",
> "type" : "phrase"
> }
> }
> },
> "filter": {
> "bool": {
> "must": [
>{
>"term": {
>   "availability.warehouse": "warehouse_a"
>}
>}
> ]
> }
> }
> }
> 
> I would like the results sorted by stock (for warehouse_a only) descending.
> 
> Any ideas?
> 
> 
> -- 
> 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/01a7baad-40e3-40b3-8104-66910762b004%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Using a nested object property within custom_filters_score script

2014-01-07 Thread Jun Ohtani
Hi Veda,

Colud you try to use _source.colours instead of doc[‘colours’].values?
Maybe,  the field in doc[] means lucene’s field name.
I think that elasticsearch is indexed the nested field as “colours.name”, not 
object.


Regards,


Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani




2014/01/02 2:49、Veda  のメール:

> Hi,
>  An example document in the index is
>  {
>"title": "Red Gucci Dress",
>"merchant": "zara",
>"price": 1972.34,
>"colours": [{"name": "red", "emd": 1.98, "percentage": 45}, {"name":
> "blue", "emd": 1.99, "percentage": 40}]
> }
> 
> and i have defined a mapping to let ES know colours is a nested object by
> posting the following json 
> 
> {
>"nested_product" : {
>"properties" : {
>"colours" : {
>"type" : "nested"
>}
>}
>}
> }
> 
> I'm facing an issue when i want to use custom_filter_score and in the
> scoring script I want to use the matched colour's properties to generate the
> score. Below is the query 
> 
> {
>  "query":{
>"custom_filters_score" : {
>"query": {"match_phrase": {"_all" : "gucci dress"}},
>"filters" : [{
>"filter" : { "nested" : { "path" : "colours",  "filter" :
> {"term" : {"colours.name" : "blue",
>"script" : "foreach(colour : doc['colours'].values){ if
> (colour.name == 'blue') {return ((0.1 * colour.percentage * colour.emd));}}"
>}
>],
>"score_mode" : "total"
>}
> }
> }
> 
> which throws an error 
> 
> Query Failed [Failed to execute main query]]; nested:
> CompileException[[Error: No field found for [colours] in mapping with types
> [nested_product]]\n[Near : {... foreach(colour : doc['colours' }]\n   
>  
> ^\n[Line: 1, Column: 1]]; nested: ElasticSearchIllegalArgumentException[No
> field found for [colours] in mapping with types [nested_product]]; "
> 
> Any help on it would be appreciated
> 
> Thanks in Advance,
> Veda
> 
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://elasticsearch-users.115913.n3.nabble.com/Using-a-nested-object-property-within-custom-filters-score-script-tp4046901.html
> Sent from the ElasticSearch Users mailing list archive at Nabble.com.
> 
> -- 
> 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/1388598575084-4046901.post%40n3.nabble.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: highlight encoder

2014-01-01 Thread Jun Ohtani
Hi,

You try to use parameter "encoder" instead of "escape_html".

See:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html#_encoder

Regards,


2014/1/1 Guozhu Wei 

> Dear all
>
> Happy new year!
>
> I have a problem when I use the highlight, I want to highlight a field
> 'abs' while it contains html, like:
>
> the content of field 'abs':
> ... The molecule:(L2L3M)n ...
>
> I want to escape the html when highlight and found that the "encoder"
> option.
>
> I use this option:
>
> "highlight": {
> "escape_html": "html",
> "pre_tags": [""],
> "post_tags": [""],
> "fields": {
> "abs": {
> "fragment_size": 150,
> "number_of_fragments": 1,
> "no_match_size": 150
> }
> }
> },
>
> but nothing changed, the html tags like '' still returned untouched.
>
> Any hints of what could be wrong?
>
> Thanks!
>
> --
> 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/CANnJ_2ObfTrUa9fvb2hkB0wNhSaPw5u9fSc_h_RM%2B56irmCMzg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5yoqwNRRuAxBOzH_DpFXzSYzA%2Bp3F4HGM%3D4aSWvVA8tZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Term facet problem

2013-12-19 Thread Jun Ohtani
Hi,

Your “Product_ID” field is “analyzed”.
You change the Product_ID field to “not_analyzed” for faceting.

If you want to search analyzed Product_ID field, then you should use 
multi_field.

See : 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-multi-field-type.html



Jun Ohtani
joht...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani




2013/12/20 16:00、abhi patel  のメール:

>  I have following data 
> 
> Action : "added"  Product_ID : slr-camera-tripod
> Action : "added"  Product_ID : slr-camera-tripod
> 
> 
> while running term facetson product_ID  it shows count like 
> 
> term : slr   count : 2
> term : camera   count : 2
> term : tripod   count : 2
> 
> which is not appropriate.
> 
> It should show like term : slr-camera-tripod count :2
> 
> How can I achieve the same?
> 
> -- 
> 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/099ee59d-1528-4941-8813-22939313a1af%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Fetching the results from two indexes - how to?

2013-12-19 Thread Jun Ohtani
Hi,

Do you want to search parent-child data structure?
Like these?

http://www.elasticsearch.org/blog/managing-relations-inside-elasticsearch/

http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/


2013/12/19 Bijuv V 

> Thanks for pointing to multiple indexes. I went through the documentation
> and it doesn't tell as to how to join the data from 2 indices.
>
> It looks like giving the result that matches certain queries from both the
> indexes. For e.g. Wow word from different comment sources.
>
>
>
>
>
>
> On Thu, Dec 19, 2013 at 11:02 AM, Jun Ohtani  wrote:
>
>> Hi,
>>
>> Do you want to search across multiple indexes (index1 and index2) ?
>>
>> If do that, you try following query or comma separate notation.
>>
>> - Indices query
>>
>> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-indices-query.html
>>  - Multiple Indices
>>
>> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/multi-index.html
>>
>> Does it make sense?
>>
>> --
>> Jun Ohtani
>>
>>
>> 2013/12/19 Bijuv V 
>>
>>> Can you suggest if this is possible or this is not possible using query
>>> DSL ? If you think its possible, a pointer would also help.
>>>
>>> Op donderdag 19 december 2013 01:35:24 UTC+1 schreef Bijuv V:
>>>
>>>>  I have some data indexed in Index 1 - for e.g - I have all of the
>>>> routes of a train listed in Index 1.
>>>>
>>>> I can search the train that goes in a particular route by querying the
>>>> index 1. This is ok.
>>>>
>>>> I have another index that has has the details of all trains that are
>>>> under maintenance.
>>>>
>>>> So from Index 2, I can get all trains that are under maintenance.
>>>>
>>>> Now the question is :
>>>>
>>>> How do I write a query that will list the routes of trains that are
>>>> under maintenance and 2) list the routes of the train that are not under
>>>> maintenance.
>>>>
>>>>  --
>>> 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/334ce1d9-c7bb-43a6-b6c6-ae357ce1b86a%40googlegroups.com
>>> .
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> --
>> ---
>> Jun Ohtani
>> blog : http://blog.johtani.info
>>
>> --
>> 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/9HeWGY25HgU/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/CAPW8A5xFBqkNg6yTzCKtLe0Gcomk45LmcQoFDcLJopHVsMO5OQ%40mail.gmail.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/CALU-2jzahWiNxMmFhFzPgW8DCLLDp-VUi1SS6JS_45tOh8obTg%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5wXnu%2Bwk7MrZh56g-s1J-Kse6d5gBXQzdG42nQ5YEEQYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Fetching the results from two indexes - how to?

2013-12-19 Thread Jun Ohtani
Hi,

Do you want to search across multiple indexes (index1 and index2) ?

If do that, you try following query or comma separate notation.

- Indices query
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-indices-query.html
- Multiple Indices
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/multi-index.html

Does it make sense?

--
Jun Ohtani


2013/12/19 Bijuv V 

> Can you suggest if this is possible or this is not possible using query
> DSL ? If you think its possible, a pointer would also help.
>
> Op donderdag 19 december 2013 01:35:24 UTC+1 schreef Bijuv V:
>
>>  I have some data indexed in Index 1 - for e.g - I have all of the routes
>> of a train listed in Index 1.
>>
>> I can search the train that goes in a particular route by querying the
>> index 1. This is ok.
>>
>> I have another index that has has the details of all trains that are
>> under maintenance.
>>
>> So from Index 2, I can get all trains that are under maintenance.
>>
>> Now the question is :
>>
>> How do I write a query that will list the routes of trains that are under
>> maintenance and 2) list the routes of the train that are not under
>> maintenance.
>>
>>  --
> 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/334ce1d9-c7bb-43a6-b6c6-ae357ce1b86a%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
---
Jun Ohtani
blog : http://blog.johtani.info

-- 
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/CAPW8A5xFBqkNg6yTzCKtLe0Gcomk45LmcQoFDcLJopHVsMO5OQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.