How to search deep?


(Namespace) #1

Hi guys. Hi have a little problem.

I have this Index:

▾ hits{}
total: 1000
max_score: 1
▾ hits[]
_index: "defaultdata"
_type: "zdata"
_id: "ETgJeWj3QV63QvMBA72G_w"
_score: 1
▾ _source{}
zName: "Little2Word2"
zType: "Rechnung"
▾ items{}
▾ Position1{}
zName: "Position1"
zType: "string"
▾ items{}
value: " generelles erfolgversprechendste"
▾ Position2{}
zName: "Position2"
zType: "string"
▾ items{}
value: " fortbleiben "

And would like to search in the items for e.g. "Position1". As far as I
know I have to specify the path with

{
"query": {
"path": "items"
}
}

but that does not work. I get instead exceptions like

{

"error": "SearchPhaseExecutionException[Failed to execute phase [query],

all shards failed; shardFailures {[IdmewBlCSN-1ZouYH877VQ][defaultdata][4]:
SearchParseException[[defaultdata][4]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object];
}{[IdmewBlCSN-1ZouYH877VQ][defaultdata][3]:
SearchParseException[[defaultdata][3]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object];
}{[IdmewBlCSN-1ZouYH877VQ][defaultdata][2]:
SearchParseException[[defaultdata][2]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object];
}{[IdmewBlCSN-1ZouYH877VQ][defaultdata][1]:
SearchParseException[[defaultdata][1]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object];
}{[IdmewBlCSN-1ZouYH877VQ][defaultdata][0]:
SearchParseException[[defaultdata][0]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object]; }]",

"status": 400

}

How can I search in "items"?
I'm using elastic search with C#, if that helps.

Thanks in advance, I'm really despair. :confused:

--
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/c875a5fd-2c34-4988-93af-69d270676310%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Adrien Grand) #2

Hi,

You didn't give your mapping, so I assume that you used dynamic mappings.
In which case you should be able to search for content in items with the
following query:

{
"query": {
"match": {
"items.value": "generelles"
}
}
}

You might want to check out
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/index.htmlthat
gives very valuable information about how to index and query data with
Elasticsearch.

On Wed, May 21, 2014 at 12:40 AM, Namespace rswhite4@gmail.com wrote:

Hi guys. Hi have a little problem.

I have this Index:

▾ hits{}
total: 1000
max_score: 1
▾ hits[]
_index: "defaultdata"
_type: "zdata"
_id: "ETgJeWj3QV63QvMBA72G_w"
_score: 1
▾ _source{}
zName: "Little2Word2"
zType: "Rechnung"
▾ items{}
▾ Position1{}
zName: "Position1"
zType: "string"
▾ items{}
value: " generelles erfolgversprechendste"
▾ Position2{}
zName: "Position2"
zType: "string"
▾ items{}
value: " fortbleiben "

And would like to search in the items for e.g. "Position1". As far as I
know I have to specify the path with

{
"query": {
"path": "items"
}
}

but that does not work. I get instead exceptions like

{

"error": "SearchPhaseExecutionException[Failed to execute phase [query],

all shards failed; shardFailures {[IdmewBlCSN-1ZouYH877VQ][defaultdata][4]:
SearchParseException[[defaultdata][4]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object];
}{[IdmewBlCSN-1ZouYH877VQ][defaultdata][3]:
SearchParseException[[defaultdata][3]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object];
}{[IdmewBlCSN-1ZouYH877VQ][defaultdata][2]:
SearchParseException[[defaultdata][2]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object];
}{[IdmewBlCSN-1ZouYH877VQ][defaultdata][1]:
SearchParseException[[defaultdata][1]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object];
}{[IdmewBlCSN-1ZouYH877VQ][defaultdata][0]:
SearchParseException[[defaultdata][0]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{\n\t"query": {\n \t"path": "items"\n
}\n}]]]; nested: QueryParsingException[[defaultdata] [_na] query
malformed, no field after start_object]; }]",

"status": 400

}

How can I search in "items"?
I'm using elastic search with C#, if that helps.

Thanks in advance, I'm really despair. :confused:

--
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/c875a5fd-2c34-4988-93af-69d270676310%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c875a5fd-2c34-4988-93af-69d270676310%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Adrien Grand

--
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/CAL6Z4j41AN%2BdGv7AgyYo9E0%2BBoVVFJv_o1RoThJEwBexO_EQCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3