Elasticsearch completion context

Multi tool use
up vote
0
down vote
favorite
I have a property which I'm indexing like this :
"tags":
"type" : "completion",
"analyzer" : "keyword",
"search_analyzer" : "keyword",
"contexts": [
"name": "loc",
"type": "geo",
"precision": 50km
]
I want my results to be sorted by closest first.
When I query my data like this:
"size" : 0 ,
"suggest" :
"result" :
"prefix" : "tex" ,
"completion" :
"field" : "tags" ,
"size" : 15 ,
"contexts" :
"loc" : [
"context" :
"lon" : 1.5,
"lat" : 43.2
,
"boost": 2
]
I get the results I want.
The issue is when I don't have data starting with "tex" within my geo point, the result is empty.
It seems that it's working as a filter.
What I want is that the context is used to sort by closest rather than filtering the data.
Is there a way to do this?
PS: I'm using ES 6.x

add a comment |
up vote
0
down vote
favorite
I have a property which I'm indexing like this :
"tags":
"type" : "completion",
"analyzer" : "keyword",
"search_analyzer" : "keyword",
"contexts": [
"name": "loc",
"type": "geo",
"precision": 50km
]
I want my results to be sorted by closest first.
When I query my data like this:
"size" : 0 ,
"suggest" :
"result" :
"prefix" : "tex" ,
"completion" :
"field" : "tags" ,
"size" : 15 ,
"contexts" :
"loc" : [
"context" :
"lon" : 1.5,
"lat" : 43.2
,
"boost": 2
]
I get the results I want.
The issue is when I don't have data starting with "tex" within my geo point, the result is empty.
It seems that it's working as a filter.
What I want is that the context is used to sort by closest rather than filtering the data.
Is there a way to do this?
PS: I'm using ES 6.x

add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a property which I'm indexing like this :
"tags":
"type" : "completion",
"analyzer" : "keyword",
"search_analyzer" : "keyword",
"contexts": [
"name": "loc",
"type": "geo",
"precision": 50km
]
I want my results to be sorted by closest first.
When I query my data like this:
"size" : 0 ,
"suggest" :
"result" :
"prefix" : "tex" ,
"completion" :
"field" : "tags" ,
"size" : 15 ,
"contexts" :
"loc" : [
"context" :
"lon" : 1.5,
"lat" : 43.2
,
"boost": 2
]
I get the results I want.
The issue is when I don't have data starting with "tex" within my geo point, the result is empty.
It seems that it's working as a filter.
What I want is that the context is used to sort by closest rather than filtering the data.
Is there a way to do this?
PS: I'm using ES 6.x

I have a property which I'm indexing like this :
"tags":
"type" : "completion",
"analyzer" : "keyword",
"search_analyzer" : "keyword",
"contexts": [
"name": "loc",
"type": "geo",
"precision": 50km
]
I want my results to be sorted by closest first.
When I query my data like this:
"size" : 0 ,
"suggest" :
"result" :
"prefix" : "tex" ,
"completion" :
"field" : "tags" ,
"size" : 15 ,
"contexts" :
"loc" : [
"context" :
"lon" : 1.5,
"lat" : 43.2
,
"boost": 2
]
I get the results I want.
The issue is when I don't have data starting with "tex" within my geo point, the result is empty.
It seems that it's working as a filter.
What I want is that the context is used to sort by closest rather than filtering the data.
Is there a way to do this?
PS: I'm using ES 6.x


asked Nov 10 at 14:43
Monta
3041316
3041316
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240047%2felasticsearch-completion-context%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
LmcsexMMo3mQFA N 2xBweei655RhyGYCNA i7E