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.
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?
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.
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.
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.
--
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.
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) ( Elasticsearch Platform — Find real-time answers at scale | Elastic)
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"
}
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?
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.