I need a help on drill down approach as i was successfully able to do the process at multi level search. The problem currently i am facing is my query gets generated twice for same option.
For eg : if i search on Price -> Title -> Color the generated query is
"bool" : {
"must" : [ {
"range" : {
"Price" : {
"from" : "52468",
"to" : "62353",
"include_lower" : true,
"include_upper" : false
}
}
}, {
"term" : {
"title" : "abc"
}
}, {
"term" : {
"color" : "white"
}
}]
}
the above query provides me a successful result.
If i change the color from white to red then the result is returned null and the query generated is
I tried using a json object which i was able to replace the color with red then the problem which occurred is i could not convert the string to QueryBuilder. I used WrapperQuery to convert string i got a encrypted data which i could not track forward it for query processing.
I need a help on drill down approach as i was successfully able to do the
process at multi level search. The problem currently i am facing is my
query
gets generated twice for same option.
For eg : if i search on Price -> Title -> Color the generated query is
*
"bool" : {
"must" : [ {
"range" : {
"Price" : {
"from" : "52468",
"to" : "62353",
"include_lower" : true,
"include_upper" : false
}
}
}, {
"term" : {
"title" : "abc"
}
}, {
"term" : {
"color" : "white"
}
}]
}*
the above query provides me a successful result.
If i change the color from white to red then the result is returned null
and
the query generated is
I tried using a json object which i was able to replace the color with red
then the problem which occurred is i could not convert the string to
QueryBuilder. I used WrapperQuery to convert string i got a encrypted
data which i could not track forward it for query processing.
Can you please let me know why we should not preserve the QueryBuilder instances? QueryBuilder will always give me result for the selected value.
Can you please give an idea how to go about.
My requirement is if i am searching on title then all results with title should be displayed. if i am adding a filter saying color then the result should be title+color combined result should be displayed.
Why not reuse a QueryBuilder instance? Because you will find yourself in
the exact situation you are in. The Builder design pattern in general is
not meant for reuse.
Internally the mustClauses are a list, not some type of map with the field
name used as a key. There is no remove method, resetting of the clauses, or
direct accesses to the clauses. That would not be part of the Builder
design pattern.
Can you please let me know why we should not preserve the QueryBuilder
instances? QueryBuilder will always give me result for the selected value.
Can you please give an idea how to go about.
My requirement is if i am searching on title then all results with title
should be displayed. if i am adding a filter saying color then the result
should be title+color combined result should be displayed.
Can you please let me know what is the best possible solution that i can use for my approach. As i have tried with lot of procedures and dint come up to the solution yet.
Thanks Ivan. For the clarification on why not to use QueryBuilder.
Can you please let me know what is the best possible solution that i can
use
for my approach. As i have tried with lot of procedures and dint come up to
the solution yet.
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.