prefix query is not returning the correct results..
in ISO Country data.. my query was
{"query":{"bool":{"must":[{"prefix":{"country.name
":"in"}}],"must_not":[],"should":[]}},"from":0,"size":50,"sort":[],"facets":{}}
and the returned result is:
{ took: 3 timed_out: false _shards: { total: 5 successful: 5 failed: 0 }
hits: { total: 3 max_score: 1 hits: [ { _index: restdb _type: country _id:
sX3-aNGBQaOjo-L7zNj7qQ _score: 1_source: { id: 519fcbce820ea8950373612b code
: ID name: INDONESIA } }{ _index: restdb _type: country _id:
YMXpIxaPRzmkMZqaKQ36pw _score: 1_source: { id: 519fcbce820ea895037360e4 code
: IO name: BRITISH INDIAN OCEAN TERRITORY }}{ _index: restdb _type:
country _id: Ok9MHCr4RLqjH6oFLX92EA _score: 1_source: { id:
519fcbce820ea8950373612a code: IN name: INDIA }}
] } }
As, you can see, red coloured data, is not matching prefix query..
Am i correct i need to do something else.., if not please help me to find
out correct way to do so, else, give me go ahead, to post this as bug.
This is because of your analyzer: it splits "BRITISH INDIAN OCEAN
TERRITORY" into ["british", "indian", "ocean", "territory"] and one of
these terms ("indian") starts with "in".
What you probably want is to apply an analyzer that only does lowercasing,
for instance by wrapping a keyword tokenizer and a lowercase token filter.
prefix query is not returning the correct results..
in ISO Country data.. my query was
{"query":{"bool":{"must":[{"prefix":{"country.name":"in"}}
],"must_not":,"should":}},"from":0,"size":50,"sort":,"facets":{}}
and the returned result is:
{ took: 3 timed_out: false _shards: { total: 5 successful: 5 failed: 0 }
hits: { total: 3 max_score: 1 hits: [ { _index: restdb _type: country _id
: sX3-aNGBQaOjo-L7zNj7qQ _score: 1_source: { id: 519fcbce820ea8950373612b
code: ID name: INDONESIA } }{ _index: restdb _type: country _id: YMXpIxa
PRzmkMZqaKQ36pw _score: 1_source: { id: 519fcbce820ea895037360e4 code: IO
name: BRITISH INDIAN OCEAN TERRITORY }}{ _index: restdb _type: country
_id: Ok9MHCr4RLqjH6oFLX92EA _score: 1_source: { id:
519fcbce820ea8950373612a code: IN name: INDIA }}
] } }
As, you can see, red coloured data, is not matching prefix query..
Am i correct i need to do something else.., if not please help me to find
out correct way to do so, else, give me go ahead, to post this as bug.
I have try analyzer on specific index field by creating multifield. And it
looks like:
"Countries" : {
"Properties" : {
"Name" : {
"Type" : "string",
"Fields" : {
"Untouched" : {
"Type" : "string",
"Index" : "no_anylzer"
}
}
}
}
}
Is it true? If yes how can I query for this field?
On Apr 3, 2015 7:39 PM, "Adrien Grand" adrien@elastic.co wrote:
This is because of your analyzer: it splits "BRITISH INDIAN OCEAN
TERRITORY" into ["british", "indian", "ocean", "territory"] and one of
these terms ("indian") starts with "in".
What you probably want is to apply an analyzer that only does lowercasing,
for instance by wrapping a keyword tokenizer and a lowercase token filter.
prefix query is not returning the correct results..
in ISO Country data.. my query was
{"query":{"bool":{"must":[{"prefix":{"country.name":"in"}}
],"must_not":,"should":}},"from":0,"size":50,"sort":,"facets":{}}
and the returned result is:
{ took: 3 timed_out: false _shards: { total: 5 successful: 5 failed: 0 }
hits: { total: 3 max_score: 1 hits: [ { _index: restdb _type: country _id
: sX3-aNGBQaOjo-L7zNj7qQ _score: 1_source: { id: 519fcbc
e820ea8950373612b code: ID name: INDONESIA } }{ _index: restdb _type:
country _id: YMXpIxaPRzmkMZqaKQ36pw _score: 1_source: { id:
519fcbce820ea895037360e4 code: IO name: BRITISH INDIAN OCEAN TERRITORY
}}{ _index: restdb _type: country _id: Ok9MHCr4RLqjH6oFLX92EA _score: 1
_source: { id: 519fcbce820ea8950373612a code: IN name: INDIA }}
] } }
As, you can see, red coloured data, is not matching prefix query..
Am i correct i need to do something else.., if not please help me to find
out correct way to do so, else, give me go ahead, to post this as bug.
On Friday, April 3, 2015 at 9:06:17 AM UTC-6, James Crone wrote:
I have try analyzer on specific index field by creating multifield. And it
looks like:
"Countries" : {
"Properties" : {
"Name" : {
"Type" : "string",
"Fields" : {
"Untouched" : {
"Type" : "string",
"Index" : "no_anylzer"
}
}
}
}
}
Is it true? If yes how can I query for this field?
On Apr 3, 2015 7:39 PM, "Adrien Grand" <adr...@elastic.co <javascript:>>
wrote:
This is because of your analyzer: it splits "BRITISH INDIAN OCEAN
TERRITORY" into ["british", "indian", "ocean", "territory"] and one of
these terms ("indian") starts with "in".
What you probably want is to apply an analyzer that only does
lowercasing, for instance by wrapping a keyword tokenizer and a lowercase
token filter.
On Fri, Apr 3, 2015 at 2:34 PM, James Crone <araf...@gmail.com
<javascript:>> wrote:
prefix query is not returning the correct results..
in ISO Country data.. my query was
{"query":{"bool":{"must":[{"prefix":{"country.name":"in"}}
],"must_not":,"should":}},"from":0,"size":50,"sort":,"facets":{}}
and the returned result is:
{ took: 3 timed_out: false _shards: { total: 5 successful: 5 failed: 0
} hits: { total: 3 max_score: 1 hits: [ { _index: restdb _type: country
_id: sX3-aNGBQaOjo-L7zNj7qQ _score: 1_source: { id: 519fcbc
e820ea8950373612b code: ID name: INDONESIA } }{ _index: restdb _type:
country _id: YMXpIxaPRzmkMZqaKQ36pw _score: 1_source: { id:
519fcbce820ea895037360e4 code: IO name: BRITISH INDIAN OCEAN TERRITORY
}}{ _index: restdb _type: country _id: Ok9MHCr4RLqjH6oFLX92EA _score: 1
_source: { id: 519fcbce820ea8950373612a code: IN name: INDIA }}
] } }
As, you can see, red coloured data, is not matching prefix query..
Am i correct i need to do something else.., if not please help me to
find out correct way to do so, else, give me go ahead, to post this as bug.
On Friday, April 3, 2015 at 9:06:17 AM UTC-6, James Crone wrote:
I have try analyzer on specific index field by creating multifield. And
it looks like:
"Countries" : {
"Properties" : {
"Name" : {
"Type" : "string",
"Fields" : {
"Untouched" : {
"Type" : "string",
"Index" : "no_anylzer"
}
}
}
}
}
Is it true? If yes how can I query for this field?
On Apr 3, 2015 7:39 PM, "Adrien Grand" adr...@elastic.co wrote:
This is because of your analyzer: it splits "BRITISH INDIAN OCEAN
TERRITORY" into ["british", "indian", "ocean", "territory"] and one of
these terms ("indian") starts with "in".
What you probably want is to apply an analyzer that only does
lowercasing, for instance by wrapping a keyword tokenizer and a lowercase
token filter.
On Fri, Apr 3, 2015 at 2:34 PM, James Crone araf...@gmail.com wrote:
prefix query is not returning the correct results..
in ISO Country data.. my query was
{"query":{"bool":{"must":[{"prefix":{"country.name":"in"}}],
"must_not":,"should":}},"from":0,"size":50,"sort":,"facets":{}}
and the returned result is:
{ took: 3 timed_out: false _shards: { total: 5 successful: 5 failed: 0
} hits: { total: 3 max_score: 1 hits: [ { _index: restdb _type:
country _id: sX3-aNGBQaOjo-L7zNj7qQ _score: 1_source: { id: 519fcbc
e820ea8950373612b code: ID name: INDONESIA } }{ _index: restdb _type:
country _id: YMXpIxaPRzmkMZqaKQ36pw _score: 1_source: { id:
519fcbce820ea895037360e4 code: IO name: BRITISH INDIAN OCEAN
TERRITORY }}{ _index: restdb _type: country _id: Ok9MHCr4RLq
jH6oFLX92EA _score: 1_source: { id: 519fcbce820ea8950373612a code: IN
name: INDIA }}
] } }
As, you can see, red coloured data, is not matching prefix query..
Am i correct i need to do something else.., if not please help me to
find out correct way to do so, else, give me go ahead, to post this as bug.
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.