Missing Query

Hello floks,
can you please help me out in identify where i am doing wrong.
Following is my missing query :
curl -XGET 'http://localhost:9200/new_index/new_indext/_search?size=0' -d'{
"query": {
"match_all": {}
},
"filter": {
"or": [
{
"missing": {
"field": "CompanyId"
}
},
{
"term": {
"CompanyId": 119
}
}
]
}
}'

I have 10 document in my elasticsearch. Only 8 of them having "CompanyId"
field.
when i run only missing query it result is correct that is 2 document which
are not having "CompanyId" field. but when i am using it with "or" function
it result is 2 document. which is wrong. I think total 10 document should
be return by the above query.

kindly help me...
thanks in advance.

Regrads
Mohit Kumar Yadav
(MCA/BBA)
Assocaite Software Developer
Next Gen Invent Corporation, Noida
Email Id : mohit.kumar@ngiventures.com,mohit.kumar.ngi@gmail.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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hard to say without the data. Have you tried only the term filter? What is
the mapping for the CompanyId field? Are you sure it is numeric? If not, is
it not-analyzed?

--
Ivan

On Sun, Apr 28, 2013 at 10:15 PM, Mohit Kumar Yadav <
mohit.kumar.ngi@gmail.com> wrote:

Hello floks,
can you please help me out in identify where i am doing wrong.
Following is my missing query :
curl -XGET 'http://localhost:9200/new_index/new_indext/_search?size=0'
-d'{
"query": {
"match_all": {}
},
"filter": {
"or": [
{
"missing": {
"field": "CompanyId"
}
},
{
"term": {
"CompanyId": 119
}
}
]
}
}'

I have 10 document in my elasticsearch. Only 8 of them having "CompanyId"
field.
when i run only missing query it result is correct that is 2 document
which are not having "CompanyId" field. but when i am using it with "or"
function it result is 2 document. which is wrong. I think total 10 document
should be return by the above query.

kindly help me...
thanks in advance.

Regrads
Mohit Kumar Yadav
(MCA/BBA)
Assocaite Software Developer
Next Gen Invent Corporation, Noida
Email Id : mohit.kumar@ngiventures.com,mohit.kumar.ngi@gmail.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+unsubscribe@googlegroups.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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,
Try to provide full curl recreation example. IMO the URL parameter 'size=0'
looks strange.
Lukáš
Dne 29.4.2013 7:15 "Mohit Kumar Yadav" mohit.kumar.ngi@gmail.com
napsal(a):

Hello floks,
can you please help me out in identify where i am doing wrong.
Following is my missing query :
curl -XGET 'http://localhost:9200/new_index/new_indext/_search?size=0'
-d'{
"query": {
"match_all": {}
},
"filter": {
"or": [
{
"missing": {
"field": "CompanyId"
}
},
{
"term": {
"CompanyId": 119
}
}
]
}
}'

I have 10 document in my elasticsearch. Only 8 of them having "CompanyId"
field.
when i run only missing query it result is correct that is 2 document
which are not having "CompanyId" field. but when i am using it with "or"
function it result is 2 document. which is wrong. I think total 10 document
should be return by the above query.

kindly help me...
thanks in advance.

Regrads
Mohit Kumar Yadav
(MCA/BBA)
Assocaite Software Developer
Next Gen Invent Corporation, Noida
Email Id : mohit.kumar@ngiventures.com,mohit.kumar.ngi@gmail.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+unsubscribe@googlegroups.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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

CompanyID Field - DataType is String.
yes.. I have only try term filter.

On Monday, April 29, 2013 10:58:06 AM UTC+5:30, Ivan Brusic wrote:

Hard to say without the data. Have you tried only the term filter? What is
the mapping for the CompanyId field? Are you sure it is numeric? If not, is
it not-analyzed?

--
Ivan

On Sun, Apr 28, 2013 at 10:15 PM, Mohit Kumar Yadav <mohit.k...@gmail.com<javascript:>

wrote:

Hello floks,
can you please help me out in identify where i am doing wrong.
Following is my missing query :
curl -XGET 'http://localhost:9200/new_index/new_indext/_search?size=0'
-d'{
"query": {
"match_all": {}
},
"filter": {
"or": [
{
"missing": {
"field": "CompanyId"
}
},
{
"term": {
"CompanyId": 119
}
}
]
}
}'

I have 10 document in my elasticsearch. Only 8 of them having "CompanyId"
field.
when i run only missing query it result is correct that is 2 document
which are not having "CompanyId" field. but when i am using it with "or"
function it result is 2 document. which is wrong. I think total 10 document
should be return by the above query.

kindly help me...
thanks in advance.

Regrads
Mohit Kumar Yadav
(MCA/BBA)
Assocaite Software Developer
Next Gen Invent Corporation, Noida
Email Id : mohit...@ngiventures.com <javascript:>,
mohit.kumar.ngi@gmail.com <javascript:>

--
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 <javascript:>.
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I think you need to set the companyId as numeric type as term query only
matches the documents that have fields that contain the term(not_analyzed) (
http://www.elasticsearch.org/guide/reference/query-dsl/term-query/)
Or, if you want to keep it as string, you can also set the companyId field
as not_analyzed, like this]
companId: {
"type" : "string"
"index" : "not_analyzed"
}

On Wed, May 1, 2013 at 11:46 AM, Mohit Kumar Yadav <
mohit.kumar.ngi@gmail.com> wrote:

CompanyID Field - DataType is String.
yes.. I have only try term filter.

On Monday, April 29, 2013 10:58:06 AM UTC+5:30, Ivan Brusic wrote:

Hard to say without the data. Have you tried only the term filter? What
is the mapping for the CompanyId field? Are you sure it is numeric? If not,
is it not-analyzed?

--
Ivan

On Sun, Apr 28, 2013 at 10:15 PM, Mohit Kumar Yadav <mohit.k...@gmail.com

wrote:

Hello floks,
can you please help me out in identify where i am doing wrong.
Following is my missing query :
curl -XGET 'http://localhost:9200/new_index/new_indext/_search?size=
0 http://localhost:9200/new_index/new_indext/_search?size=0' -d'{
"query": {
"match_all": {}
},
"filter": {
"or": [
{
"missing": {
"field": "CompanyId"
}
},
{
"term": {
"CompanyId": 119
}
}
]
}
}'

I have 10 document in my elasticsearch. Only 8 of them having
"CompanyId" field.
when i run only missing query it result is correct that is 2 document
which are not having "CompanyId" field. but when i am using it with "or"
function it result is 2 document. which is wrong. I think total 10 document
should be return by the above query.

kindly help me...
thanks in advance.

Regrads
Mohit Kumar Yadav
(MCA/BBA)
Assocaite Software Developer
Next Gen Invent Corporation, Noida
Email Id : mohit...@ngiventures.com,mo**hit.kumar.ngi@gmail.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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Thanks,
Aash

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.