Priority field in filter

I'm a newbie of ES but I have a question below is my document
{"id" : 1, "title" : "Mr", "firstname" : "Money" , "lastname" : "Gold"}
{"id" : 2, "title" : "Mr", "firstname" : "Silver" , "lastname" : "Money}
{"id" : 3, "title" : "Mr", "firstname" : "Platinum" , "lastname" :
"Bronze"}

And I query data via API that developer provides as below and I cannot
change query format but I can change index structure or rebuild it
{
"query": {
"filtered": {
"query": {
"match_all": {
}
},
"filter": {
"and": [{
"or": [{
"bool": {
"must": {
"terms": {
"firstname.raw": ["Money"],
}
}
}
},
{
"bool": {
"must": {
"terms": {
"lastname.raw": ["Money"]
}
}
}
}]
},
{
"bool": {
"must": {
"terms": {
"title.raw": ["Mr"]
}
}
}
}]
}
}
}
}

That return id no. 1 and 2 and both score is 1, so I want to set priority
"firstname" field higher than "lastname" field.
Is this possible? How can I do?

Please advise me.....

Thanks
Hiko

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ffa0b059-db70-4a65-956a-75fcec2e6a1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

More information: When I call API I send parameters as below
"firstname" : "Money",
"lastname" : "Money",
"title" : "Mr"

Assumption : The key field is "title" and "firstname" and "lastname" fields
will be used "OR" condition everytime I call via API

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f6bab56c-2bcd-4c69-a7e0-bd6721948280%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

More question: Can be used "boost" in "term filter"? if yes, How to use?
and give me some sample

Thanks
Hiko

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8c3dcdf4-0b51-4ae5-b386-93639c7cad99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

A filter does not participate in scoring.
But using Elasticsearch Platform — Find real-time answers at scale | Elastic http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html you can assign a score to a filter.

My 2 cents

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 10 févr. 2015 à 09:17, tao hiko taohiko@gmail.com a écrit :

More question: Can be used "boost" in "term filter"? if yes, How to use? and give me some sample

Thanks
Hiko

--
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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8c3dcdf4-0b51-4ae5-b386-93639c7cad99%40googlegroups.com https://groups.google.com/d/msgid/elasticsearch/8c3dcdf4-0b51-4ae5-b386-93639c7cad99%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout 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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/69E3EE0B-8A5A-43DF-A51D-F501027A7620%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Hi David

Thank you for your information, more question; Can I set "boost" or
priority on each fields in mapping? if I use "term query" instead of "term
filter".

Hiko

On Tuesday, February 10, 2015 at 3:19:26 PM UTC+7, David Pilato wrote:

A filter does not participate in scoring.
But using
Elasticsearch Platform — Find real-time answers at scale | Elastic you
can assign a score to a filter.

My 2 cents

--
David Pilato | Technical Advocate | Elasticsearch.com
http://Elasticsearch.com

@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/656892e4-c945-4d14-b81a-90087a31147c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yeah. But I’d recommend not using boost in mapping but at query time.
More flexible.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 10 févr. 2015 à 09:29, tao hiko taohiko@gmail.com a écrit :

Hi David

Thank you for your information, more question; Can I set "boost" or priority on each fields in mapping? if I use "term query" instead of "term filter".

Hiko

On Tuesday, February 10, 2015 at 3:19:26 PM UTC+7, David Pilato wrote:
A filter does not participate in scoring.
But using Elasticsearch Platform — Find real-time answers at scale | Elastic http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html you can assign a score to a filter.

My 2 cents

--
David Pilato | Technical Advocate | Elasticsearch.com http://elasticsearch.com/
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

--
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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/656892e4-c945-4d14-b81a-90087a31147c%40googlegroups.com https://groups.google.com/d/msgid/elasticsearch/656892e4-c945-4d14-b81a-90087a31147c%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout 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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/26163CAF-0F92-4CB5-8F6B-FA31933ECD0F%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Thank you for your recommendation, I will try it.

Hiko

On Tuesday, February 10, 2015 at 3:31:46 PM UTC+7, David Pilato wrote:

Yeah. But I’d recommend not using boost in mapping but at query time.
More flexible.

--
David Pilato | Technical Advocate | Elasticsearch.com
http://Elasticsearch.com

@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 10 févr. 2015 à 09:29, tao hiko <tao...@gmail.com <javascript:>> a
écrit :

Hi David

Thank you for your information, more question; Can I set "boost" or
priority on each fields in mapping? if I use "term query" instead of "term
filter".

Hiko

On Tuesday, February 10, 2015 at 3:19:26 PM UTC+7, David Pilato wrote:

A filter does not participate in scoring.
But using
Elasticsearch Platform — Find real-time answers at scale | Elastic you
can assign a score to a filter.

My 2 cents

--
David Pilato | Technical Advocate | Elasticsearch.com
http://elasticsearch.com/

@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

--
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:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/656892e4-c945-4d14-b81a-90087a31147c%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/656892e4-c945-4d14-b81a-90087a31147c%40googlegroups.com?utm_medium=email&utm_source=footer
.
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5b43defa-c65b-4efb-a7af-eee8f4fb32f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.