Field "region" was indexed without position data; cannot run PhraseQuery


(xu piao) #1

i have an exception when i use 'query_string' to search with 'multi_field'
.

my docs is indexed by json
,like:{"region":"北京北京市海淀区","name":"群下子群|成员测试-82282","intra":"taipeng","geo":{"lon":116.3092,"lat":39.98364},"address":"泰鹏大厦"}

the field not all my docs have

my search request :
{
"bool" : {
"must" : {
"query_string" : {
"query" : "北京西路",
"fields" : [ "region"]
}
},
"minimum_should_match" : "1"
}
}

my mappings :

matrix: {

  • mappings: {
    • group: {
      • properties: {
      • region: {
        • type: string
        • store: true
        • analyzer: ik
          }
    • }
    • }

}

}

exception :org.elasticsearch.action.search.SearchPhaseExecutionException:
Failed to execute phase [query], all shards failed; shardFailures
{[C_c2mxBJS7KVuP2tcb1aIw][matrix][0]:
RemoteTransportException[[Auric][inet[/10.0.8.102:19300]][search/phase/query]];
nested: QueryPhaseExecutionException[[matrix][0]:
query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@6f26b9e7>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[jwf1krq1QY27yqNt1_2vVQ][matrix][4]:
QueryPhaseExecutionException[[matrix][4]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@43ececca>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[jwf1krq1QY27yqNt1_2vVQ][matrix][3]:
QueryPhaseExecutionException[[matrix][3]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@70e10093>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[C_c2mxBJS7KVuP2tcb1aIw][matrix][2]:
RemoteTransportException[[Auric][inet[/10.0.8.102:19300]][search/phase/query]];
nested: QueryPhaseExecutionException[[matrix][2]:
query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@577725b3>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[jwf1krq1QY27yqNt1_2vVQ][matrix][1]:
QueryPhaseExecutionException[[matrix][1]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@5fd068b>]:
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)

--
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/1c21f47a-3a42-4ad1-90b6-94ffbd6b269a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Ivan Brusic) #2

Your mapping does not seem correct. Can you post the output of the get
mapping API instead? It appears that the region field might be a geo type
instead. Analyzed fields should have position data enabled by default.

--
Ivan

On Tue, Jul 22, 2014 at 8:46 PM, xu piao xupiaobj@gmail.com wrote:

i have an exception when i use 'query_string' to search with 'multi_field'
.

my docs is indexed by json
,like:{"region":"北京北京市海淀区","name":"群下子群|成员测试-82282","intra":"taipeng","geo":{"lon":116.3092,"lat":39.98364},"address":"泰鹏大厦"}

the field not all my docs have

my search request :
{
"bool" : {
"must" : {
"query_string" : {
"query" : "北京西路",
"fields" : [ "region"]
}
},
"minimum_should_match" : "1"
}
}

my mappings :

matrix: {

  • mappings: {
    • group: {
      • properties: {
      • region: {
        • type: string
        • store: true
        • analyzer: ik
          }
    • }
    • }

}

}

exception :org.elasticsearch.action.search.SearchPhaseExecutionException:
Failed to execute phase [query], all shards failed; shardFailures
{[C_c2mxBJS7KVuP2tcb1aIw][matrix][0]:
RemoteTransportException[[Auric][inet[/10.0.8.102:19300]][search/phase/query]];
nested: QueryPhaseExecutionException[[matrix][0]:
query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@6f26b9e7>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[jwf1krq1QY27yqNt1_2vVQ][matrix][4]:
QueryPhaseExecutionException[[matrix][4]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@43ececca>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[jwf1krq1QY27yqNt1_2vVQ][matrix][3]:
QueryPhaseExecutionException[[matrix][3]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@70e10093>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[C_c2mxBJS7KVuP2tcb1aIw][matrix][2]:
RemoteTransportException[[Auric][inet[/10.0.8.102:19300]][search/phase/query]];
nested: QueryPhaseExecutionException[[matrix][2]:
query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@577725b3>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[jwf1krq1QY27yqNt1_2vVQ][matrix][1]:
QueryPhaseExecutionException[[matrix][1]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@5fd068b>]:
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)

--
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/1c21f47a-3a42-4ad1-90b6-94ffbd6b269a%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/1c21f47a-3a42-4ad1-90b6-94ffbd6b269a%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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/CALY%3DcQCitLgNkOQX68WZYdND7DF-%2Bj46VvpcUnznyR0-WvAUxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(xu piao) #3

this is my mapping :
{

  • "matrix":{
    • "mappings":{
      • "group":{
        • "properties":{
          • "address":{
            • "type":"string",
            • "store":true,
            • "analyzer":"ik"
              },
          • "geo":{
            • "type":"geo_point",
            • "store":true
              },
          • "intra":{
            • "type":"string",
            • "store":true,
            • "analyzer":"ik"
              },
          • "name":{
            • "type":"string",
            • "store":true,
            • "analyzer":"ik"
              },
          • "region":{
            • "type":"string",
            • "store":true,
            • "analyzer":"ik"
              },
          • "tags":{
            • "type":"string",
            • "store":true,
            • "analyzer":"ik"
              }
              }
              }
              }
              }

}

在 2014年7月23日星期三UTC+8下午1时44分09秒,Ivan Brusic写道:

Your mapping does not seem correct. Can you post the output of the get
mapping API instead? It appears that the region field might be a geo type
instead. Analyzed fields should have position data enabled by default.

--
Ivan

On Tue, Jul 22, 2014 at 8:46 PM, xu piao <xupi...@gmail.com <javascript:>>
wrote:

i have an exception when i use 'query_string' to search with
'multi_field' .

my docs is indexed by json
,like:{"region":"北京北京市海淀区","name":"群下子群|成员测试-82282","intra":"taipeng","geo":{"lon":116.3092,"lat":39.98364},"address":"泰鹏大厦"}

the field not all my docs have

my search request :
{
"bool" : {
"must" : {
"query_string" : {
"query" : "北京西路",
"fields" : [ "region"]
}
},
"minimum_should_match" : "1"
}
}

my mappings :

matrix: {

  • mappings: {
    • group: {
      • properties: {
      • region: {
        • type: string
        • store: true
        • analyzer: ik
          }
    • }
    • }

}

}

exception :org.elasticsearch.action.search.SearchPhaseExecutionException:
Failed to execute phase [query], all shards failed; shardFailures
{[C_c2mxBJS7KVuP2tcb1aIw][matrix][0]:
RemoteTransportException[[Auric][inet[/10.0.8.102:19300]][search/phase/query]];
nested: QueryPhaseExecutionException[[matrix][0]:
query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@6f26b9e7>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[jwf1krq1QY27yqNt1_2vVQ][matrix][4]:
QueryPhaseExecutionException[[matrix][4]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@43ececca>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[jwf1krq1QY27yqNt1_2vVQ][matrix][3]:
QueryPhaseExecutionException[[matrix][3]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@70e10093>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[C_c2mxBJS7KVuP2tcb1aIw][matrix][2]:
RemoteTransportException[[Auric][inet[/10.0.8.102:19300]][search/phase/query]];
nested: QueryPhaseExecutionException[[matrix][2]:
query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@577725b3>]:
Query Failed [Failed to execute main query]]; nested:
IllegalStateException[field "region" was indexed without position data;
cannot run PhraseQuery (term=北京)]; }{[jwf1krq1QY27yqNt1_2vVQ][matrix][1]:
QueryPhaseExecutionException[[matrix][1]: query[filtered((region:"北京
西路"))->cache(_type:group)],from[0],size[20],sort[<custom:"geo":
org.elasticsearch.index.fielddata.fieldcomparator.GeoDistanceComparatorSource@5fd068b>]:
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)

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/1c21f47a-3a42-4ad1-90b6-94ffbd6b269a%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/1c21f47a-3a42-4ad1-90b6-94ffbd6b269a%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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/8d083186-1d41-4d52-b22b-313944ee4bb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4