I am trying to run following query. I want to boost the record if its name
contains a word pizza. Is there anything wrong in my query?. All the
records (53) returned by filter contain the word "Houston" in field
addrtext. Now I want to boost those records which contain the word pizza in
field name. I have been trying for few days with different queries but no
luck yet.
What am I missing?
Hi,
what you are currently doing with your filtered query is 1) filtering out
all the documents that don't match the addrtext:Houston query 2) executing
the query on top of those documents.
The fact that you give a boost to the name field doesn't make any
difference since that's the only field you are searching on. The fields
weight makes sense only when searching on multiple fields, or eventually if
you have multiple queries in OR (e.g. using a bool query with should
clauses).
Cheers
Luca
On Wednesday, October 9, 2013 10:16:29 PM UTC+2, ravi...@gmail.com wrote:
I am trying to run following query. I want to boost the record if its name
contains a word pizza. Is there anything wrong in my query?. All the
records (53) returned by filter contain the word "Houston" in field
addrtext. Now I want to boost those records which contain the word pizza in
field name. I have been trying for few days with different queries but no
luck yet.
What am I missing?
That is exactly what is happening. The filter is behaving correctly. It is
returning results containing "Houston".
The query has no effect at all.
So how do I fix this?
Basically what I want is this.
I have a set of AND filters that return me say 53 results.
Now let us say 3 of these records contain a word pizza in another field.
I want to modify the query or filter so that I get the same 53 results with
3 records containing pizza on top.
How can I do this?
Ravi
On Thursday, October 10, 2013 8:33:45 AM UTC-4, Luca Cavanna wrote:
Hi,
what you are currently doing with your filtered query is 1) filtering out
all the documents that don't match the addrtext:Houston query 2) executing
the query on top of those documents.
The fact that you give a boost to the name field doesn't make any
difference since that's the only field you are searching on. The fields
weight makes sense only when searching on multiple fields, or eventually if
you have multiple queries in OR (e.g. using a bool query with should
clauses).
Cheers
Luca
On Wednesday, October 9, 2013 10:16:29 PM UTC+2, ravi...@gmail.com wrote:
I am trying to run following query. I want to boost the record if its
name contains a word pizza. Is there anything wrong in my query?. All the
records (53) returned by filter contain the word "Houston" in field
addrtext. Now I want to boost those records which contain the word pizza in
field name. I have been trying for few days with different queries but no
luck yet.
What am I missing?
Hi,
all documents you get back match both the filter and the query. You might
want to add the explain=true parameter to your request to know more about
what is going on under the hood.
I think I got what you want to achieve though. I would go with a bool query
that has a match_all as must clause and your query as should clause, so
that it's not mandatory but if it does match thoase documents will be
boosted. I would also replace the query_string with the match query.
That is exactly what is happening. The filter is behaving correctly. It is
returning results containing "Houston".
The query has no effect at all.
So how do I fix this?
Basically what I want is this.
I have a set of AND filters that return me say 53 results.
Now let us say 3 of these records contain a word pizza in another field.
I want to modify the query or filter so that I get the same 53 results
with 3 records containing pizza on top.
How can I do this?
Ravi
On Thursday, October 10, 2013 8:33:45 AM UTC-4, Luca Cavanna wrote:
Hi,
what you are currently doing with your filtered query is 1) filtering out
all the documents that don't match the addrtext:Houston query 2) executing
the query on top of those documents.
The fact that you give a boost to the name field doesn't make any
difference since that's the only field you are searching on. The fields
weight makes sense only when searching on multiple fields, or eventually if
you have multiple queries in OR (e.g. using a bool query with should
clauses).
Cheers
Luca
On Wednesday, October 9, 2013 10:16:29 PM UTC+2, ravi...@gmail.com wrote:
I am trying to run following query. I want to boost the record if its
name contains a word pizza. Is there anything wrong in my query?. All the
records (53) returned by filter contain the word "Houston" in field
addrtext. Now I want to boost those records which contain the word pizza in
field name. I have been trying for few days with different queries but no
luck yet.
What am I missing?
On Friday, October 11, 2013 4:47:27 AM UTC-4, Luca Cavanna wrote:
Hi,
all documents you get back match both the filter and the query. You might
want to add the explain=true parameter to your request to know more about
what is going on under the hood.
I think I got what you want to achieve though. I would go with a bool
query that has a match_all as must clause and your query as should clause,
so that it's not mandatory but if it does match thoase documents will be
boosted. I would also replace the query_string with the match query.
On Fri, Oct 11, 2013 at 3:22 AM, <ravi...@gmail.com <javascript:>> wrote:
That is exactly what is happening. The filter is behaving correctly. It
is returning results containing "Houston".
The query has no effect at all.
So how do I fix this?
Basically what I want is this.
I have a set of AND filters that return me say 53 results.
Now let us say 3 of these records contain a word pizza in another field.
I want to modify the query or filter so that I get the same 53 results
with 3 records containing pizza on top.
How can I do this?
Ravi
On Thursday, October 10, 2013 8:33:45 AM UTC-4, Luca Cavanna wrote:
Hi,
what you are currently doing with your filtered query is 1) filtering
out all the documents that don't match the addrtext:Houston query 2)
executing the query on top of those documents.
The fact that you give a boost to the name field doesn't make any
difference since that's the only field you are searching on. The fields
weight makes sense only when searching on multiple fields, or eventually if
you have multiple queries in OR (e.g. using a bool query with should
clauses).
Cheers
Luca
On Wednesday, October 9, 2013 10:16:29 PM UTC+2, ravi...@gmail.comwrote:
I am trying to run following query. I want to boost the record if its
name contains a word pizza. Is there anything wrong in my query?. All the
records (53) returned by filter contain the word "Houston" in field
addrtext. Now I want to boost those records which contain the word pizza in
field name. I have been trying for few days with different queries but no
luck yet.
What am I missing?
Declared victory too soon. Your suggestion works but there is a
complication.
I have a sort section in the end. It is sorting by distance. The distance
sorting is working correct but it is messing up with results of the query.
Ideally I would like the order of all sorted results to be maintained and
only those results matching the "should" query should get bumped up in
final list. At present it is behaving as if the query section is not
present.
Is there any way to do this?
I tried sorting by distance as well as the field but did not have the
effect.
Any suggestions?
On Friday, October 11, 2013 4:47:27 AM UTC-4, Luca Cavanna wrote:
Hi,
all documents you get back match both the filter and the query. You might
want to add the explain=true parameter to your request to know more about
what is going on under the hood.
I think I got what you want to achieve though. I would go with a bool
query that has a match_all as must clause and your query as should clause,
so that it's not mandatory but if it does match thoase documents will be
boosted. I would also replace the query_string with the match query.
On Fri, Oct 11, 2013 at 3:22 AM, <ravi...@gmail.com <javascript:>> wrote:
That is exactly what is happening. The filter is behaving correctly. It
is returning results containing "Houston".
The query has no effect at all.
So how do I fix this?
Basically what I want is this.
I have a set of AND filters that return me say 53 results.
Now let us say 3 of these records contain a word pizza in another field.
I want to modify the query or filter so that I get the same 53 results
with 3 records containing pizza on top.
How can I do this?
Ravi
On Thursday, October 10, 2013 8:33:45 AM UTC-4, Luca Cavanna wrote:
Hi,
what you are currently doing with your filtered query is 1) filtering
out all the documents that don't match the addrtext:Houston query 2)
executing the query on top of those documents.
The fact that you give a boost to the name field doesn't make any
difference since that's the only field you are searching on. The fields
weight makes sense only when searching on multiple fields, or eventually if
you have multiple queries in OR (e.g. using a bool query with should
clauses).
Cheers
Luca
On Wednesday, October 9, 2013 10:16:29 PM UTC+2, ravi...@gmail.comwrote:
I am trying to run following query. I want to boost the record if its
name contains a word pizza. Is there anything wrong in my query?. All the
records (53) returned by filter contain the word "Houston" in field
addrtext. Now I want to boost those records which contain the word pizza in
field name. I have been trying for few days with different queries but no
luck yet.
What am I missing?
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.