at above guidence it say i can use _type + field name to avoid analyzer
conflicts. but i have try many times all is no use.
i have a index with two type is group and user which all have 'region'
field conflict .
group :
region: {
type: string
store: true
analyzer: ik
}
user:
region: {
type: "long"
}
as guidence say :
We can avoid this problem either by naming the fields differently — eg
title_en and title_es — or by explicitly including the type name in the
field name and querying each field separately:
I do query like this
{
"bool" : {
"must" : {
"query_string" : {
"query" : ""北京西路"",
"fields" : [ "group.name^20", "group.tags^5", "group.intra^1",
"group.region^2", "group.address^2" ]
}
},
"minimum_should_match" : "1"
}
}
but no use . it still throw exception .
why ???
exception :
org.elasticsearch.search.query.QueryPhaseExecutionException: [matrix][4]:
query[filtered((name:"闵行区 吴 宝 路"^20.0 | tags:"闵行区 吴 宝 路"^5.0 | intra:"闵行区 吴
宝 路" | region:"闵行区 吴 宝 路"^2.0 | address:"闵行区 吴 宝
路"^2.0))->cache(_type:group)],from[0],size[20]: Query Failed [Failed to
execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:127)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:257)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:202)
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:292)
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)
Caused by: java.lang.IllegalStateException: field "region" was indexed
without position data; cannot run PhraseQuery (term=闵行区)
at
org.apache.lucene.search.PhraseQuery$PhraseWeight.scorer(PhraseQuery.java:278)
at
org.apache.lucene.search.DisjunctionMaxQuery$DisjunctionMaxWeight.scorer(DisjunctionMaxQuery.java:161)
at
org.apache.lucene.search.FilteredQuery$RandomAccessFilterStrategy.filteredScorer(FilteredQuery.java:531)
at
org.apache.lucene.search.FilteredQuery$1.scorer(FilteredQuery.java:136)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:618)
at
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:173)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:491)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:448)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:281)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:269)
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:123)
... 8 more
The issue is that the region field in group is indexed with positional
data, while the region field in user is indexed without. This is
something that Elasticsearch cannot deal with. You should try to give the region field different names in group and user.
at above guidence it say i can use _type + field name to avoid analyzer
conflicts. but i have try many times all is no use.
i have a index with two type is group and user which all have 'region'
field conflict .
group :
region: {
type: string
store: true
analyzer: ik
}
user:
region: {
type: "long"
}
as guidence say :
We can avoid this problem either by naming the fields differently — eg
title_en and title_es — or by explicitly including the type name in the
field name and querying each field separately:
I do query like this
{
"bool" : {
"must" : {
"query_string" : {
"query" : ""北京西路"",
"fields" : [ "group.name^20", "group.tags^5", "group.intra^1",
"group.region^2", "group.address^2" ]
}
},
"minimum_should_match" : "1"
}
}
but no use . it still throw exception .
why ???
exception :
org.elasticsearch.search.query.QueryPhaseExecutionException: [matrix][4]:
query[filtered((name:"闵行区 吴 宝 路"^20.0 | tags:"闵行区 吴 宝 路"^5.0 | intra:"闵行区 吴
宝 路" | region:"闵行区 吴 宝 路"^2.0 | address:"闵行区 吴 宝
路"^2.0))->cache(_type:group)],from[0],size[20]: Query Failed [Failed to
execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:127)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:257)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:202)
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:292)
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)
Caused by: java.lang.IllegalStateException: field "region" was indexed
without position data; cannot run PhraseQuery (term=闵行区)
at
org.apache.lucene.search.PhraseQuery$PhraseWeight.scorer(PhraseQuery.java:278)
at
org.apache.lucene.search.DisjunctionMaxQuery$DisjunctionMaxWeight.scorer(DisjunctionMaxQuery.java:161)
at
org.apache.lucene.search.FilteredQuery$RandomAccessFilterStrategy.filteredScorer(FilteredQuery.java:531)
at
org.apache.lucene.search.FilteredQuery$1.scorer(FilteredQuery.java:136)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:618)
at
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:173)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:491)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:448)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:281)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:269)
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:123)
... 8 more
Why it no use when i explicitly type name to separate query field ?
or that meanning : only two type 'region' field all indexed can use this
way to separate query field , not one of them is indexed can use?
sorry my english is poor .
Maybe I did not express clearly what I mean。
在 2014年7月26日星期六UTC+8上午1时16分25秒,Adrien Grand写道:
Hi,
The issue is that the region field in group is indexed with positional
data, while the region field in user is indexed without. This is
something that Elasticsearch cannot deal with. You should try to give the region field different names in group and user.
On Fri, Jul 25, 2014 at 9:34 AM, xu piao <xupi...@gmail.com <javascript:>>
wrote:
at above guidence it say i can use _type + field name to avoid analyzer
conflicts. but i have try many times all is no use.
i have a index with two type is group and user which all have 'region'
field conflict .
group :
region: {
type: string
store: true
analyzer: ik
}
user:
region: {
type: "long"
}
as guidence say :
We can avoid this problem either by naming the fields differently — eg
title_en and title_es — or by explicitly including the type name in the
field name and querying each field separately:
GET /_search
{
"query": {
"multi_match": { <http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/mapping.html#CO30-1>
"query": "The quick brown fox",
"fields": [ "blog_en.title", "blog_es.title" ]
}
}
}
I do query like this
{
"bool" : {
"must" : {
"query_string" : {
"query" : ""北京西路"",
"fields" : [ "group.name^20", "group.tags^5", "group.intra^1",
"group.region^2", "group.address^2" ]
}
},
"minimum_should_match" : "1"
}
}
but no use . it still throw exception .
why ???
exception :
org.elasticsearch.search.query.QueryPhaseExecutionException: [matrix][4]:
query[filtered((name:"闵行区 吴 宝 路"^20.0 | tags:"闵行区 吴 宝 路"^5.0 | intra:"闵行区 吴
宝 路" | region:"闵行区 吴 宝 路"^2.0 | address:"闵行区 吴 宝
路"^2.0))->cache(_type:group)],from[0],size[20]: Query Failed [Failed to
execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:127)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:257)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:202)
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:292)
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)
Caused by: java.lang.IllegalStateException: field "region" was indexed
without position data; cannot run PhraseQuery (term=闵行区)
at
org.apache.lucene.search.PhraseQuery$PhraseWeight.scorer(PhraseQuery.java:278)
at
org.apache.lucene.search.DisjunctionMaxQuery$DisjunctionMaxWeight.scorer(DisjunctionMaxQuery.java:161)
at
org.apache.lucene.search.FilteredQuery$RandomAccessFilterStrategy.filteredScorer(FilteredQuery.java:531)
at
org.apache.lucene.search.FilteredQuery$1.scorer(FilteredQuery.java:136)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:618)
at
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:173)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:491)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:448)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:281)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:269)
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:123)
... 8 more
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.