Searching over multiple untouched fields without "_all"


(Nd Coderific) #1

Hi there,

I´m new to Elasticsearch.

I tried to search over multiple untouched fields with the following query:

{
"from" : searchPageNumberFTS,
"size":10,
"sort":{},
"query":[ {
"filtered" : {
"query" : {
"wildcard" :
{ "Product.untouched":searchTextFulltextSearch}

} ,
"filter": {
"or":[
{
"query": {
"wildcard": {
"Test.untouched": "*"
}
}
}
]
}
},"filtered" : {
"query" : {
"wildcard" :
{ "Project.untouched":searchTextFulltextSearch}

} ,
"filter": {
"or":[
{
"query": {
"wildcard": {
"Test.untouched": "*"
}
}
}
]
}
}
}]
};
But the 1st query was overwritten! It resolves as :

  1. {"from":0,"size":10,"sort":{},"query":[{"filtered":{"query":{
    "wildcard":{"Project.untouched":"CRI**1"}},"filter":{"or":[{"query":{
    "wildcard":{"Test.untouched":"*"}}}]}}}]}:

is there any posiblility to search over more the one untouched field ?

Greetings
ND

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


(Ivan Brusic) #2

You need to combine the different queries with a bool query instead of
creating an array of queries:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html

Also, are you sure you want to use a query filter that is essentially a
match all? Not sure what you heop to achieve, but perhaps the exist filter
might be more appropriate:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-exists-filter.html

Cheers,

Ivan

On Wed, Nov 13, 2013 at 6:18 AM, Nd Coderific
andreas.coder@googlemail.comwrote:

Hi there,

I´m new to Elasticsearch.

I tried to search over multiple untouched fields with the following query:

{
"from" : searchPageNumberFTS,
"size":10,
"sort":{},
"query":[ {
"filtered" : {
"query" : {
"wildcard" :
{ "Product.untouched":searchTextFulltextSearch}

} ,
"filter": {
"or":[
{
"query": {
"wildcard": {
"Test.untouched": "*"
}
}
}
]
}
},"filtered" : {
"query" : {
"wildcard" :
{ "Project.untouched":searchTextFulltextSearch}

} ,
"filter": {
"or":[
{
"query": {
"wildcard": {
"Test.untouched": "*"
}
}
}
]
}
}
}]
};
But the 1st query was overwritten! It resolves as :

  1. {"from":0,"size":10,"sort":{},"query":[{"filtered":{"query":{
    "wildcard":{"Project.untouched":"CRI**1"}},"filter":{"or":[{"query":{
    "wildcard":{"Test.untouched":"*"}}}]}}}]}:

is there any posiblility to search over more the one untouched field ?

Greetings
ND

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3