Re: Filter by specific value without mapping

2014-10-17 Thread Vladimir Krylov
Tried to remove papping and make not_analizable
curl -XPUT "http://$HOST:9200/reports"; -d'
{
   "mappings": {
  "_default_": {
 "dynamic_templates": [
{
   "store_generic" : {
   "match" : "*",
   "match_mapping_type" : "string",
   "mapping" : {
   "type" : "string",
   "index" : "not_analyzed"
   }
   }

}
 ]
  }
   }
}'


But Easy filtering returns empty results for "approved", "not approved" or 
"". Search example

curl -X GET 'http://localhost:9200/reports/_search?pretty' -d '{
  "filter":{
"term":{
  "general.approval":  "approved" 
}
  }
}
'




Should I do other filtering syntax for this case?



On Tuesday, October 7, 2014 5:17:02 PM UTC+3, Ivan Brusic wrote:
>
> The field do not need a custom analyzer, they just need to be simply 
> marked as non_analyzed.
>
> You can setup a dynamic template that states any new field should be non 
> analyzed.
>
>
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-root-object-type.html#_dynamic_templates
>
> You can still hardcode the mapping for specific fields.
>
> Cheers,
>
> Ivan
> On Oct 7, 2014 2:57 AM, "Vladimir Krylov" > 
> wrote:
>
>> What I'm trying to do is to get data  by filtering term with exact 
>> matching. I have ES 1.3.2 and I cannot do mapping, as attributes are 
>> dynamic (different users has different attributes). My data:
>>
>> { id: 111,
>> org_id: 11,
>> approval: "approved",
>> ...
>> }
>>
>>
>>
>>
>> { id: 112,
>> org_id: 11,
>> approval: "not approved",
>> ...
>> }
>>
>>
>> This request returns results:
>>
>> curl -X GET 'host:9200/data/_search?pretty' -d '{
>>   "filter":{
>> "term":{
>>   "approval":"approved"
>> }
>>   }
>> }
>>
>>
>>
>> But this not:
>>
>> curl -X GET 'host:9200/reports/_search?pretty' -d '{
>>   "filter":{
>> "term":{
>>   "approval":"not approved"
>> }
>>   }
>> }
>>
>>
>>
>> It's a dup of ticket 
>> https://github.com/elasticsearch/elasticsearch/issues/8006#issuecomment-58160111
>>  
>> As I was followed here. 
>>
>> David Pilato proposed that "index has indexed probably not and approved" 
>> and that there is no exact matching to "not approved". I tried to search 
>> for word "not" and it works
>>
>> curl -X GET 'host:9200/reports/_search?pretty' -d '{
>>   "filter":{
>> "term":{
>>   "approval":"not"
>> }
>>   }
>> }
>>
>> So, how can I filter by exact word matching "not approved"?
>>
>>  -- 
>> 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/6ea46153-68a7-481f-9064-9e094094bf29%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/4cc3fe20-296c-4a63-af9c-ec1516e3f54e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Filter by specific value without mapping

2014-10-07 Thread Ivan Brusic
The field do not need a custom analyzer, they just need to be simply marked
as non_analyzed.

You can setup a dynamic template that states any new field should be non
analyzed.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-root-object-type.html#_dynamic_templates

You can still hardcode the mapping for specific fields.

Cheers,

Ivan
On Oct 7, 2014 2:57 AM, "Vladimir Krylov"  wrote:

> What I'm trying to do is to get data  by filtering term with exact
> matching. I have ES 1.3.2 and I cannot do mapping, as attributes are
> dynamic (different users has different attributes). My data:
>
> { id: 111,
> org_id: 11,
> approval: "approved",
> ...
> }
>
>
>
>
> { id: 112,
> org_id: 11,
> approval: "not approved",
> ...
> }
>
>
> This request returns results:
>
> curl -X GET 'host:9200/data/_search?pretty' -d '{
>   "filter":{
> "term":{
>   "approval":"approved"
> }
>   }
> }
>
>
>
> But this not:
>
> curl -X GET 'host:9200/reports/_search?pretty' -d '{
>   "filter":{
> "term":{
>   "approval":"not approved"
> }
>   }
> }
>
>
>
> It's a dup of ticket
> https://github.com/elasticsearch/elasticsearch/issues/8006#issuecomment-58160111
> As I was followed here.
>
> David Pilato proposed that "index has indexed probably not and approved"
> and that there is no exact matching to "not approved". I tried to search
> for word "not" and it works
>
> curl -X GET 'host:9200/reports/_search?pretty' -d '{
>   "filter":{
> "term":{
>   "approval":"not"
> }
>   }
> }
>
> So, how can I filter by exact word matching "not approved"?
>
>  --
> 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/6ea46153-68a7-481f-9064-9e094094bf29%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/CALY%3DcQDpvwRMPmLTX2ung%2BS6o8nz0k2mMtgmvZwEQMSCygRAPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Filter by specific value without mapping

2014-10-07 Thread Vladimir Krylov
I tried to set custom default analyzer  
curl -XPUT 'host:9200/reports' -d '
{
"settings":{
"analysis": {
"analyzer": {
"default":{
"type": "pattern",
"pattern":"_" // I know that cannot get 
this splitter
}
}
}
}
}'
curl 'http://host:9200/reports/_analyze?pretty=1&field=filter__approval' -d 
'not approved' # returns full string as one token
curl 'http://host:9200/reports/_analyze?pretty=1' -d 'foo,bar baz ASD: " 
fdfd "'# returns full string as one token

Seems to be working. Is there better solution?


On Tuesday, October 7, 2014 12:57:32 PM UTC+3, Vladimir Krylov wrote:
>
> What I'm trying to do is to get data  by filtering term with exact 
> matching. I have ES 1.3.2 and I cannot do mapping, as attributes are 
> dynamic (different users has different attributes). My data:
>
> { id: 111,
> org_id: 11,
> approval: "approved",
> ...
> }
>
>
>
>
> { id: 112,
> org_id: 11,
> approval: "not approved",
> ...
> }
>
>
> This request returns results:
>
> curl -X GET 'host:9200/data/_search?pretty' -d '{
>   "filter":{
> "term":{
>   "approval":"approved"
> }
>   }
> }
>
>
>
> But this not:
>
> curl -X GET 'host:9200/reports/_search?pretty' -d '{
>   "filter":{
> "term":{
>   "approval":"not approved"
> }
>   }
> }
>
>
>
> It's a dup of ticket 
> https://github.com/elasticsearch/elasticsearch/issues/8006#issuecomment-58160111
>  
> As I was followed here. 
>
> David Pilato proposed that "index has indexed probably not and approved" 
> and that there is no exact matching to "not approved". I tried to search 
> for word "not" and it works
>
> curl -X GET 'host:9200/reports/_search?pretty' -d '{
>   "filter":{
> "term":{
>   "approval":"not"
> }
>   }
> }
>
> So, how can I filter by exact word matching "not approved"?
>
>

-- 
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/ff22ac98-2028-4476-862e-7a2bb82c4f52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Filter by specific value without mapping

2014-10-07 Thread Vladimir Krylov
Just to be clear, actually I don't need any analyzer on filters

On Tuesday, October 7, 2014 12:57:32 PM UTC+3, Vladimir Krylov wrote:
>
> What I'm trying to do is to get data  by filtering term with exact 
> matching. I have ES 1.3.2 and I cannot do mapping, as attributes are 
> dynamic (different users has different attributes). My data:
>
> { id: 111,
> org_id: 11,
> approval: "approved",
> ...
> }
>
>
>
>
> { id: 112,
> org_id: 11,
> approval: "not approved",
> ...
> }
>
>
> This request returns results:
>
> curl -X GET 'host:9200/data/_search?pretty' -d '{
>   "filter":{
> "term":{
>   "approval":"approved"
> }
>   }
> }
>
>
>
> But this not:
>
> curl -X GET 'host:9200/reports/_search?pretty' -d '{
>   "filter":{
> "term":{
>   "approval":"not approved"
> }
>   }
> }
>
>
>
> It's a dup of ticket 
> https://github.com/elasticsearch/elasticsearch/issues/8006#issuecomment-58160111
>  
> As I was followed here. 
>
> David Pilato proposed that "index has indexed probably not and approved" 
> and that there is no exact matching to "not approved". I tried to search 
> for word "not" and it works
>
> curl -X GET 'host:9200/reports/_search?pretty' -d '{
>   "filter":{
> "term":{
>   "approval":"not"
> }
>   }
> }
>
> So, how can I filter by exact word matching "not approved"?
>
>

-- 
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/b4160387-cc59-48e4-9a96-ed29f32b4a6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Filter by specific value without mapping

2014-10-07 Thread Vladimir Krylov
What I'm trying to do is to get data  by filtering term with exact 
matching. I have ES 1.3.2 and I cannot do mapping, as attributes are 
dynamic (different users has different attributes). My data:

{ id: 111,
org_id: 11,
approval: "approved",
...
}




{ id: 112,
org_id: 11,
approval: "not approved",
...
}


This request returns results:

curl -X GET 'host:9200/data/_search?pretty' -d '{
  "filter":{
"term":{
  "approval":"approved"
}
  }
}



But this not:

curl -X GET 'host:9200/reports/_search?pretty' -d '{
  "filter":{
"term":{
  "approval":"not approved"
}
  }
}



It's a dup of 
ticket 
https://github.com/elasticsearch/elasticsearch/issues/8006#issuecomment-58160111
 
As I was followed here. 

David Pilato proposed that "index has indexed probably not and approved" 
and that there is no exact matching to "not approved". I tried to search 
for word "not" and it works

curl -X GET 'host:9200/reports/_search?pretty' -d '{
  "filter":{
"term":{
  "approval":"not"
}
  }
}

So, how can I filter by exact word matching "not approved"?

-- 
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/6ea46153-68a7-481f-9064-9e094094bf29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.