i have one index with different _type like http://localhost:9200/matrix/group
and http://localhost:9200/matrix/user
the two _type all have 'region' field but with different type.
group :
- region: {
- type: string
- store: true
- analyzer: ik
}
}
user:
- region: {
- type: "long"
}
- type: "long"
when 'matrix' index only have 'group' type.
i do search use 'query_string' with multi_field is ok
{
"bool" : {
"must" : {
"query_string" : {
"query" : "北京西城",
"fields" : [ "name^20", "tags^5", "intra^1", "region^2",
"address^2" ]
}
},
"minimum_should_match" : "1"
}
}
but when i index 'user' type .do zhe same query it will throw exception
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to
execute phase [query], all shards failed; shardFailures
{[_vgvj_11QpKOuZNo90nD_A][matrix][0]: RemoteTransportException[[Blizzard
II][inet[/10.0.8.235:19300]][search/phase/query]]; nested:
QueryPhaseExecutionException[[matrix][0]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "region" was
indexed without position data; cannot run PhraseQuery (term=北京)];
}{[_vgvj_11QpKOuZNo90nD_A][matrix][4]: RemoteTransportException[[Blizzard
II][inet[/10.0.8.235:19300]][search/phase/query]]; nested:
QueryPhaseExecutionException[[matrix][4]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "region" was
indexed without position data; cannot run PhraseQuery (term=北京)];
}{[_vgvj_11QpKOuZNo90nD_A][matrix][3]: RemoteTransportException[[Blizzard
II][inet[/10.0.8.235:19300]][search/phase/query]]; nested:
QueryPhaseExecutionException[[matrix][3]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "region" was
indexed without position data; cannot run PhraseQuery (term=北京)];
}{[3XK6HZ_WSbG4E7Tot3mMMw][matrix][2]:
QueryPhaseExecutionException[[matrix][2]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "region" was
indexed without position data; cannot run PhraseQuery (term=北京)];
}{[3XK6HZ_WSbG4E7Tot3mMMw][matrix][1]:
QueryPhaseExecutionException[[matrix][1]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "region" was
indexed without position data; cannot run PhraseQuery (term=北京)]; }
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:276)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:224)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:216)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$4.run(TransportSearchTypeAction.java:296)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
all my search request has assign type in java like :
SearchRequestBuilder searchRequest =
esClient.prepareSearch("matrix").setTypes("group")
.setSearchType(SearchType.QUERY_THEN_FETCH).setFrom(form).setSize(count).setExplain(true);
why ??
--
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/850a4e92-1b7c-4564-9769-16bcdb9d4333%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.