IllegalStateException[field \"DISPLAY_NAME\" was indexed without position data

Hi,

I am trying to query some records via the span_first query as below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason": 

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it. Thanks.

--
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/ad8740af-2038-40d4-9fc2-79d6e1402e5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Your mapping looks correct. Which version are you running? Do you have any
templates?

Just to be on the safe side, can you provide the mapping that Elasticsearch
is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.com wrote:

Hi,

I am trying to query some records via the span_first query as below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it. Thanks.

--
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/ad8740af-2038-40d4-9fc2-79d6e1402e5a%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any templates.
Not sure whether your are referring to the full index mapping here's the
gist

media mapping

full index mapping

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.com wrote:

Your mapping looks correct. Which version are you running? Do you have any
templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.com wrote:

Hi,

I am trying to query some records via the span_first query as below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it. Thanks.

--
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/ad8740af-2038-40d4-9fc2-79d6e1402e5a%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

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

Hi Ivan,

I recreate the mapping and re-index the documents and now working fine.
Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start with happy
holiday
.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any templates.
Not sure whether your are referring to the full index mapping here's the
gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.com wrote:

Your mapping looks correct. Which version are you running? Do you have
any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.com wrote:

Hi,

I am trying to query some records via the span_first query as below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason": 

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it. Thanks.

--
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/ad8740af-2038-40d4-9fc2-79d6e1402e5a%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

The main limitation of the span queries is that they only operate on
analyzed terms. The terms used in span_term must match the terms in the
index. In your case, there is no single term "happy holiday" in your index,
because the original document was tokenized into "happy" "birthday" "to"
"you".

You would need to do a span near query of the two terms with a slop of 1
and in order. This span near query will then be the argument to the span
first.

Here is a good explanation of span queries in Lucene:
http://searchhub.org/2009/07/18/the-spanquery/

--
Ivan

On Sun, Apr 27, 2014 at 11:24 PM, cyrilforce cheehoo84@gmail.com wrote:

Hi Ivan,

I recreate the mapping and re-index the documents and now working fine.
Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start with happy
holiday
.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any
templates. Not sure whether your are referring to the full index mapping
here's the gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.com wrote:

Your mapping looks correct. Which version are you running? Do you have
any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.com wrote:

Hi,

I am trying to query some records via the span_first query as below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it. Thanks.

--
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/ad8740af-2038-40d4-9fc2-79d6e1402e5a%
40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%
3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%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%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Ivan,

Not able to get any result with the following query :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    "end" : 1
}

}
}

Meanwhile tried with :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_term" : { "DISPLAY_NAME" : "happy" }
},
"end" : 1
}
}
}

and it returns :

  "_index": "jdbc_dev",
            "_type": "media",
            "_id": "9556",
            "_score": 4.612431,
            "_source": {
                "DISPLAY_NAME": "Happy People",

Anything wrong with my first query ?

Thanks

On Tue, Apr 29, 2014 at 12:16 AM, Ivan Brusic ivan@brusic.com wrote:

The main limitation of the span queries is that they only operate on
analyzed terms. The terms used in span_term must match the terms in the
index. In your case, there is no single term "happy holiday" in your index,
because the original document was tokenized into "happy" "birthday" "to"
"you".

You would need to do a span near query of the two terms with a slop of 1
and in order. This span near query will then be the argument to the span
first.

Here is a good explanation of span queries in Lucene:
http://searchhub.org/2009/07/18/the-spanquery/

--
Ivan

On Sun, Apr 27, 2014 at 11:24 PM, cyrilforce cheehoo84@gmail.com wrote:

Hi Ivan,

I recreate the mapping and re-index the documents and now working fine.
Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start with happy
holiday
.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any
templates. Not sure whether your are referring to the full index mapping
here's the gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.com wrote:

Your mapping looks correct. Which version are you running? Do you have
any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.comwrote:

Hi,

I am trying to query some records via the span_first query as below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it.
Thanks.

--
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/ad8740af-2038-40d4-9fc2-79d6e1402e5a%
40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%
3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

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

The end parameter is too low. It needs to be at a minimum the number of
clauses in the span_near query.

--
Ivan

On Mon, Apr 28, 2014 at 7:05 PM, chee hoo lum cheehoo84@gmail.com wrote:

Hi Ivan,

Not able to get any result with the following query :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    "end" : 1
}

}
}

Meanwhile tried with :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_term" : { "DISPLAY_NAME" : "happy" }
},
"end" : 1
}
}
}

and it returns :

  "_index": "jdbc_dev",
            "_type": "media",
            "_id": "9556",
            "_score": 4.612431,
            "_source": {
                "DISPLAY_NAME": "Happy People",

Anything wrong with my first query ?

Thanks

On Tue, Apr 29, 2014 at 12:16 AM, Ivan Brusic ivan@brusic.com wrote:

The main limitation of the span queries is that they only operate on
analyzed terms. The terms used in span_term must match the terms in the
index. In your case, there is no single term "happy holiday" in your index,
because the original document was tokenized into "happy" "birthday" "to"
"you".

You would need to do a span near query of the two terms with a slop of 1
and in order. This span near query will then be the argument to the span
first.

Here is a good explanation of span queries in Lucene:
http://searchhub.org/2009/07/18/the-spanquery/

--
Ivan

On Sun, Apr 27, 2014 at 11:24 PM, cyrilforce cheehoo84@gmail.comwrote:

Hi Ivan,

I recreate the mapping and re-index the documents and now working fine.
Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start with happy
holiday
.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any
templates. Not sure whether your are referring to the full index mapping
here's the gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.com wrote:

Your mapping looks correct. Which version are you running? Do you have
any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.comwrote:

Hi,

I am trying to query some records via the span_first query as below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it.
Thanks.

--
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/ad8740af-2038-40d4-9fc2-79d6e1402e5a%
40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%
3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.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%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Ivan,

Tried with 2 and 3 with no luck.

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    *"end" : 2*
}

}
}

The field is using "standard" analyzer with stopword=_none:

"DISPLAY_NAME": {
"type": "string",
"analyzer": "standard"
},

"index.analysis.analyzer.standard.type": "standard",
"index.analysis.analyzer.standard.stopwords": "none"

Any clue on this ? :slight_smile: Thanks

On Wed, Apr 30, 2014 at 12:37 AM, Ivan Brusic ivan@brusic.com wrote:

The end parameter is too low. It needs to be at a minimum the number of
clauses in the span_near query.

--
Ivan

On Mon, Apr 28, 2014 at 7:05 PM, chee hoo lum cheehoo84@gmail.com wrote:

Hi Ivan,

Not able to get any result with the following query :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    "end" : 1
}

}
}

Meanwhile tried with :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_term" : { "DISPLAY_NAME" : "happy" }
},
"end" : 1
}
}
}

and it returns :

  "_index": "jdbc_dev",
            "_type": "media",
            "_id": "9556",
            "_score": 4.612431,
            "_source": {
                "DISPLAY_NAME": "Happy People",

Anything wrong with my first query ?

Thanks

On Tue, Apr 29, 2014 at 12:16 AM, Ivan Brusic ivan@brusic.com wrote:

The main limitation of the span queries is that they only operate on
analyzed terms. The terms used in span_term must match the terms in the
index. In your case, there is no single term "happy holiday" in your index,
because the original document was tokenized into "happy" "birthday"
"to" "you".

You would need to do a span near query of the two terms with a slop of 1
and in order. This span near query will then be the argument to the span
first.

Here is a good explanation of span queries in Lucene:
http://searchhub.org/2009/07/18/the-spanquery/

--
Ivan

On Sun, Apr 27, 2014 at 11:24 PM, cyrilforce cheehoo84@gmail.comwrote:

Hi Ivan,

I recreate the mapping and re-index the documents and now working fine.
Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start with happy
holiday
.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any
templates. Not sure whether your are referring to the full index mapping
here's the gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.com wrote:

Your mapping looks correct. Which version are you running? Do you
have any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.comwrote:

Hi,

I am trying to query some records via the span_first query as below
:

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it.
Thanks.

--
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/ad8740af-
2038-40d4-9fc2-79d6e1402e5a%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%
3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Do you have any documents that starts with "happy people"?

--
Ivan

On Tue, Apr 29, 2014 at 7:21 PM, chee hoo lum cheehoo84@gmail.com wrote:

Hi Ivan,

Tried with 2 and 3 with no luck.

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    *"end" : 2*
}

}
}

The field is using "standard" analyzer with stopword=_none:

"DISPLAY_NAME": {
"type": "string",
"analyzer": "standard"
},

"index.analysis.analyzer.standard.type": "standard",
"index.analysis.analyzer.standard.stopwords": "none"

Any clue on this ? :slight_smile: Thanks

On Wed, Apr 30, 2014 at 12:37 AM, Ivan Brusic ivan@brusic.com wrote:

The end parameter is too low. It needs to be at a minimum the number of
clauses in the span_near query.

--
Ivan

On Mon, Apr 28, 2014 at 7:05 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Not able to get any result with the following query :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    "end" : 1
}

}
}

Meanwhile tried with :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_term" : { "DISPLAY_NAME" : "happy" }
},
"end" : 1
}
}
}

and it returns :

  "_index": "jdbc_dev",
            "_type": "media",
            "_id": "9556",
            "_score": 4.612431,
            "_source": {
                "DISPLAY_NAME": "Happy People",

Anything wrong with my first query ?

Thanks

On Tue, Apr 29, 2014 at 12:16 AM, Ivan Brusic ivan@brusic.com wrote:

The main limitation of the span queries is that they only operate on
analyzed terms. The terms used in span_term must match the terms in the
index. In your case, there is no single term "happy holiday" in your index,
because the original document was tokenized into "happy" "birthday"
"to" "you".

You would need to do a span near query of the two terms with a slop of
1 and in order. This span near query will then be the argument to the span
first.

Here is a good explanation of span queries in Lucene:
http://searchhub.org/2009/07/18/the-spanquery/

--
Ivan

On Sun, Apr 27, 2014 at 11:24 PM, cyrilforce cheehoo84@gmail.comwrote:

Hi Ivan,

I recreate the mapping and re-index the documents and now working
fine. Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start with happy
holiday
.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any
templates. Not sure whether your are referring to the full index mapping
here's the gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.com wrote:

Your mapping looks correct. Which version are you running? Do you
have any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.comwrote:

Hi,

I am trying to query some records via the span_first query as below
:

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it.
Thanks.

--
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/ad8740af-
2038-40d4-9fc2-79d6e1402e5a%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%
3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.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%3DcQDubi%2Bf9W50UtMc4GJ2XpuoGSB7se0b7o31Zs6GKfLFZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Ivan,

Running the following query it returns records below :

{
"query" : { "match" : {"DISPLAY_NAME" : "Happy People"} }
}

Result :

but running with span query suggested:

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

     ],
     "slop" : 1,
     "in_order" : true
 }
    },
    *"end" : 2*
}

}
}

no result returned.

Any clues :slight_smile:

Thanks.

On Wed, Apr 30, 2014 at 12:04 PM, Ivan Brusic ivan@brusic.com wrote:

Do you have any documents that starts with "happy people"?

--
Ivan

On Tue, Apr 29, 2014 at 7:21 PM, chee hoo lum cheehoo84@gmail.com wrote:

Hi Ivan,

Tried with 2 and 3 with no luck.

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    *"end" : 2*
}

}
}

The field is using "standard" analyzer with stopword=_none:

"DISPLAY_NAME": {
"type": "string",
"analyzer": "standard"
},

"index.analysis.analyzer.standard.type": "standard",
"index.analysis.analyzer.standard.stopwords": "none"

Any clue on this ? :slight_smile: Thanks

On Wed, Apr 30, 2014 at 12:37 AM, Ivan Brusic ivan@brusic.com wrote:

The end parameter is too low. It needs to be at a minimum the number of
clauses in the span_near query.

--
Ivan

On Mon, Apr 28, 2014 at 7:05 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Not able to get any result with the following query :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    "end" : 1
}

}
}

Meanwhile tried with :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_term" : { "DISPLAY_NAME" : "happy" }
},
"end" : 1
}
}
}

and it returns :

  "_index": "jdbc_dev",
            "_type": "media",
            "_id": "9556",
            "_score": 4.612431,
            "_source": {
                "DISPLAY_NAME": "Happy People",

Anything wrong with my first query ?

Thanks

On Tue, Apr 29, 2014 at 12:16 AM, Ivan Brusic ivan@brusic.com wrote:

The main limitation of the span queries is that they only operate on
analyzed terms. The terms used in span_term must match the terms in the
index. In your case, there is no single term "happy holiday" in your index,
because the original document was tokenized into "happy" "birthday"
"to" "you".

You would need to do a span near query of the two terms with a slop of
1 and in order. This span near query will then be the argument to the span
first.

Here is a good explanation of span queries in Lucene:
http://searchhub.org/2009/07/18/the-spanquery/

--
Ivan

On Sun, Apr 27, 2014 at 11:24 PM, cyrilforce cheehoo84@gmail.comwrote:

Hi Ivan,

I recreate the mapping and re-index the documents and now working
fine. Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start
with happy holiday.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any
templates. Not sure whether your are referring to the full index mapping
here's the gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.comwrote:

Your mapping looks correct. Which version are you running? Do you
have any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.comwrote:

Hi,

I am trying to query some records via the span_first query as
below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it.
Thanks.

--
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/ad8740af-
2038-40d4-9fc2-79d6e1402e5a%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%
3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDubi%2Bf9W50UtMc4GJ2XpuoGSB7se0b7o31Zs6GKfLFZg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDubi%2Bf9W50UtMc4GJ2XpuoGSB7se0b7o31Zs6GKfLFZg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg_vm-nbt%3D%2BcysQ7WJc0LXan_hoF%3D%2BBLt%3DzC6H-dRVpYDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

You should provide a full curl recreation with your exact documents and
mappings: Elasticsearch Platform — Find real-time answers at scale | Elastic

I have no issues executing a similar query. Note that the terms in
span_term are not analyzed, but that should not matter for those words
using the standard analyzer.

--
Ivan

On Tue, Apr 29, 2014 at 10:59 PM, chee hoo lum cheehoo84@gmail.com wrote:

Hi Ivan,

Running the following query it returns records below :

{
"query" : { "match" : {"DISPLAY_NAME" : "Happy People"} }
}

Result :
query_match_result.txt · GitHub

but running with span query suggested:

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

     ],
     "slop" : 1,
     "in_order" : true
 }
    },
    *"end" : 2*
}

}
}

no result returned.

Any clues :slight_smile:

Thanks.

On Wed, Apr 30, 2014 at 12:04 PM, Ivan Brusic ivan@brusic.com wrote:

Do you have any documents that starts with "happy people"?

--
Ivan

On Tue, Apr 29, 2014 at 7:21 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Tried with 2 and 3 with no luck.

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    *"end" : 2*
}

}
}

The field is using "standard" analyzer with stopword=_none:

"DISPLAY_NAME": {
"type": "string",
"analyzer": "standard"
},

"index.analysis.analyzer.standard.type": "standard",
"index.analysis.analyzer.standard.stopwords": "none"

Any clue on this ? :slight_smile: Thanks

On Wed, Apr 30, 2014 at 12:37 AM, Ivan Brusic ivan@brusic.com wrote:

The end parameter is too low. It needs to be at a minimum the number of
clauses in the span_near query.

--
Ivan

On Mon, Apr 28, 2014 at 7:05 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Not able to get any result with the following query :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    "end" : 1
}

}
}

Meanwhile tried with :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_term" : { "DISPLAY_NAME" : "happy" }
},
"end" : 1
}
}
}

and it returns :

  "_index": "jdbc_dev",
            "_type": "media",
            "_id": "9556",
            "_score": 4.612431,
            "_source": {
                "DISPLAY_NAME": "Happy People",

Anything wrong with my first query ?

Thanks

On Tue, Apr 29, 2014 at 12:16 AM, Ivan Brusic ivan@brusic.com wrote:

The main limitation of the span queries is that they only operate on
analyzed terms. The terms used in span_term must match the terms in the
index. In your case, there is no single term "happy holiday" in your index,
because the original document was tokenized into "happy" "birthday"
"to" "you".

You would need to do a span near query of the two terms with a slop
of 1 and in order. This span near query will then be the argument to the
span first.

Here is a good explanation of span queries in Lucene:
http://searchhub.org/2009/07/18/the-spanquery/

--
Ivan

On Sun, Apr 27, 2014 at 11:24 PM, cyrilforce cheehoo84@gmail.comwrote:

Hi Ivan,

I recreate the mapping and re-index the documents and now working
fine. Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start
with happy holiday.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any
templates. Not sure whether your are referring to the full index mapping
here's the gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.comwrote:

Your mapping looks correct. Which version are you running? Do you
have any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.comwrote:

Hi,

I am trying to query some records via the span_first query as
below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it.
Thanks.

--
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/ad8740af-
2038-40d4-9fc2-79d6e1402e5a%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%
3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%
40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%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 a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDubi%2Bf9W50UtMc4GJ2XpuoGSB7se0b7o31Zs6GKfLFZg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDubi%2Bf9W50UtMc4GJ2XpuoGSB7se0b7o31Zs6GKfLFZg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg_vm-nbt%3D%2BcysQ7WJc0LXan_hoF%3D%2BBLt%3DzC6H-dRVpYDQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg_vm-nbt%3D%2BcysQ7WJc0LXan_hoF%3D%2BBLt%3DzC6H-dRVpYDQ%40mail.gmail.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%3DcQAn5pTivuh4p5Qt-dUt0wtBMNWrBy80X81f_0Cu0hRAsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Ivan,

The gist for the curl recreation :

Thanks.

On Wed, Apr 30, 2014 at 2:42 PM, Ivan Brusic ivan@brusic.com wrote:

You should provide a full curl recreation with your exact documents and
mappings: Elasticsearch Platform — Find real-time answers at scale | Elastic

I have no issues executing a similar query. Note that the terms in
span_term are not analyzed, but that should not matter for those words
using the standard analyzer.

--
Ivan

On Tue, Apr 29, 2014 at 10:59 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Running the following query it returns records below :

{
"query" : { "match" : {"DISPLAY_NAME" : "Happy People"} }
}

Result :
query_match_result.txt · GitHub

but running with span query suggested:

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

     ],
     "slop" : 1,
     "in_order" : true
 }
    },
    *"end" : 2*
}

}
}

no result returned.

Any clues :slight_smile:

Thanks.

On Wed, Apr 30, 2014 at 12:04 PM, Ivan Brusic ivan@brusic.com wrote:

Do you have any documents that starts with "happy people"?

--
Ivan

On Tue, Apr 29, 2014 at 7:21 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Tried with 2 and 3 with no luck.

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    *"end" : 2*
}

}
}

The field is using "standard" analyzer with stopword=_none:

"DISPLAY_NAME": {
"type": "string",
"analyzer": "standard"
},

"index.analysis.analyzer.standard.type": "standard",
"index.analysis.analyzer.standard.stopwords": "none"

Any clue on this ? :slight_smile: Thanks

On Wed, Apr 30, 2014 at 12:37 AM, Ivan Brusic ivan@brusic.com wrote:

The end parameter is too low. It needs to be at a minimum the number
of clauses in the span_near query.

--
Ivan

On Mon, Apr 28, 2014 at 7:05 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Not able to get any result with the following query :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    "end" : 1
}

}
}

Meanwhile tried with :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_term" : { "DISPLAY_NAME" : "happy" }
},
"end" : 1
}
}
}

and it returns :

  "_index": "jdbc_dev",
            "_type": "media",
            "_id": "9556",
            "_score": 4.612431,
            "_source": {
                "DISPLAY_NAME": "Happy People",

Anything wrong with my first query ?

Thanks

On Tue, Apr 29, 2014 at 12:16 AM, Ivan Brusic ivan@brusic.comwrote:

The main limitation of the span queries is that they only operate on
analyzed terms. The terms used in span_term must match the terms in the
index. In your case, there is no single term "happy holiday" in your index,
because the original document was tokenized into "happy" "birthday"
"to" "you".

You would need to do a span near query of the two terms with a slop
of 1 and in order. This span near query will then be the argument to the
span first.

Here is a good explanation of span queries in Lucene:
http://searchhub.org/2009/07/18/the-spanquery/

--
Ivan

On Sun, Apr 27, 2014 at 11:24 PM, cyrilforce cheehoo84@gmail.comwrote:

Hi Ivan,

I recreate the mapping and re-index the documents and now working
fine. Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start
with happy holiday.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any
templates. Not sure whether your are referring to the full index mapping
here's the gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.comwrote:

Your mapping looks correct. Which version are you running? Do you
have any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce cheehoo84@gmail.comwrote:

Hi,

I am trying to query some records via the span_first query as
below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it.
Thanks.

--
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/ad8740af-
2038-40d4-9fc2-79d6e1402e5a%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic
in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/
cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%
3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%
40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%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 a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDubi%2Bf9W50UtMc4GJ2XpuoGSB7se0b7o31Zs6GKfLFZg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDubi%2Bf9W50UtMc4GJ2XpuoGSB7se0b7o31Zs6GKfLFZg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg_vm-nbt%3D%2BcysQ7WJc0LXan_hoF%3D%2BBLt%3DzC6H-dRVpYDQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg_vm-nbt%3D%2BcysQ7WJc0LXan_hoF%3D%2BBLt%3DzC6H-dRVpYDQ%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAn5pTivuh4p5Qt-dUt0wtBMNWrBy80X81f_0Cu0hRAsQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAn5pTivuh4p5Qt-dUt0wtBMNWrBy80X81f_0Cu0hRAsQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg_-kS3nn82h-rxZxVDMJREpZM5G8O0ygkc6_Onzm-98Ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

You are using a keyword tokenizer, so your fields are not being tokenized
at all. If you are always interested in just the start of the field, you
can perhaps use a prefix query:

--
Ivan

On Wed, Apr 30, 2014 at 12:24 AM, chee hoo lum cheehoo84@gmail.com wrote:

Hi Ivan,

The gist for the curl recreation :
span_term_curl_recreation.json · GitHub

Thanks.

On Wed, Apr 30, 2014 at 2:42 PM, Ivan Brusic ivan@brusic.com wrote:

You should provide a full curl recreation with your exact documents and
mappings: Elasticsearch Platform — Find real-time answers at scale | Elastic

I have no issues executing a similar query. Note that the terms in
span_term are not analyzed, but that should not matter for those words
using the standard analyzer.

--
Ivan

On Tue, Apr 29, 2014 at 10:59 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Running the following query it returns records below :

{
"query" : { "match" : {"DISPLAY_NAME" : "Happy People"} }
}

Result :
query_match_result.txt · GitHub

but running with span query suggested:

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

     ],
     "slop" : 1,
     "in_order" : true
 }
    },
    *"end" : 2*
}

}
}

no result returned.

Any clues :slight_smile:

Thanks.

On Wed, Apr 30, 2014 at 12:04 PM, Ivan Brusic ivan@brusic.com wrote:

Do you have any documents that starts with "happy people"?

--
Ivan

On Tue, Apr 29, 2014 at 7:21 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Tried with 2 and 3 with no luck.

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    *"end" : 2*
}

}
}

The field is using "standard" analyzer with stopword=_none:

"DISPLAY_NAME": {
"type": "string",
"analyzer": "standard"
},

"index.analysis.analyzer.standard.type": "standard",
"index.analysis.analyzer.standard.stopwords": "none"

Any clue on this ? :slight_smile: Thanks

On Wed, Apr 30, 2014 at 12:37 AM, Ivan Brusic ivan@brusic.com wrote:

The end parameter is too low. It needs to be at a minimum the number
of clauses in the span_near query.

--
Ivan

On Mon, Apr 28, 2014 at 7:05 PM, chee hoo lum cheehoo84@gmail.comwrote:

Hi Ivan,

Not able to get any result with the following query :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_near" : {
"clauses" : [
{ "span_term" : { "DISPLAY_NAME" : "happy" } },
{ "span_term" : { "DISPLAY_NAME" : "people" } }

    ],
    "slop" : 1,
    "in_order" : true
}
    },
    "end" : 1
}

}
}

Meanwhile tried with :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
"span_term" : { "DISPLAY_NAME" : "happy" }
},
"end" : 1
}
}
}

and it returns :

  "_index": "jdbc_dev",
            "_type": "media",
            "_id": "9556",
            "_score": 4.612431,
            "_source": {
                "DISPLAY_NAME": "Happy People",

Anything wrong with my first query ?

Thanks

On Tue, Apr 29, 2014 at 12:16 AM, Ivan Brusic ivan@brusic.comwrote:

The main limitation of the span queries is that they only operate
on analyzed terms. The terms used in span_term must match the terms in the
index. In your case, there is no single term "happy holiday" in your index,
because the original document was tokenized into "happy"
"birthday" "to" "you".

You would need to do a span near query of the two terms with a slop
of 1 and in order. This span near query will then be the argument to the
span first.

Here is a good explanation of span queries in Lucene:
http://searchhub.org/2009/07/18/the-spanquery/

--
Ivan

On Sun, Apr 27, 2014 at 11:24 PM, cyrilforce cheehoo84@gmail.comwrote:

Hi Ivan,

I recreate the mapping and re-index the documents and now working
fine. Thanks.

Btw would like to ask how i could search two or more words in the
span_first query as i need it to support the following searches :
1)happy
2)happy holiday
3)happy birthday to you

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy holiday" }*
},
"end" : 1
}
}
}

returns empty list even we have documents that display_name start
with happy holiday.

Thanks.

On Sunday, April 27, 2014 2:55:37 AM UTC+8, cyrilforce wrote:

Hi Ivan,

I am using version elasticsearch-0.90.1. Nope we don't have any
templates. Not sure whether your are referring to the full index mapping
here's the gist

media mapping
span_first_issue_media_mapping.json · GitHub

full index mapping
span_first_issue_full_index_mappping.json · GitHub

Thanks in advance.

On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic ivan@brusic.comwrote:

Your mapping looks correct. Which version are you running? Do
you have any templates?

Just to be on the safe side, can you provide the mapping that
Elasticsearch is using (not the one you provide):

http://localhost:9200/jdbc_dev/media/_mapping

--
Ivan

On Fri, Apr 25, 2014 at 3:24 AM, cyrilforce <cheehoo84@gmail.com

wrote:

Hi,

I am trying to query some records via the span_first query as
below :

{
"from" : 100,
"size" : 100,
"query" : {
"span_first" : {
"match" : {
* "span_term" : { "DISPLAY_NAME" : "happy" }*
},
"end" : 1
}
}
}

however it returned me with an error :

        "index": "jdbc_dev",
            "shard": 4,
            "status": 500,
        *    "reason":

"RemoteTransportException[[portal-web-02][inet[/192.168.96.27:9300]][search/phase/query/id]];
nested: QueryPhaseExecutionException[[jdbc_dev][4]:
query[filtered(spanFirst(DISPLAY_NAME:happy,
1))->cache(_type:media)],from[100],size[100]: Query Failed [Failed to
execute main query]]; nested: IllegalStateException[field "DISPLAY_NAME"
was indexed without position data; cannot run SpanTermQuery (term=happy)];
"*
}

The mapping for that type :

{
"media": {
"properties": {
"AUDIO": {
"type": "string"
},
"BILLINGTYPE_ID": {
"type": "long"
},
"CATMEDIA_CDATE": {
"type": "date",
"format": "dateOptionalTime"
},
"CATMEDIA_NAME": {
"type": "string"
},
"CATMEDIA_RANK": {
"type": "long"
},
"CAT_ID": {
"type": "long"
},
"CAT_NAME": {
"type": "string",
"analyzer": "string_lowercase",
"include_in_all": true
},
"CAT_PARENT": {
"type": "long"
},
"CHANNEL_ID": {
"type": "long"
},
"CKEY": {
"type": "long"
},
* "DISPLAY_NAME": {*

  •            "type": "string",*
    
  •            "analyzer": "standard"*
    
  •        },*
          "FTID": {
              "type": "string"
          },
          "GENRE": {
              "type": "string"
          },
          "ITEMCODE": {
              "type": "string"
          },
          "KEYWORDS": {
              "type": "string"
          },
          "LANG_ID": {
              "type": "long"
          },
          "LONG_DESCRIPTION": {
              "type": "string"
          },
          "MAPPINGS": {
              "type": "string",
              "analyzer": "string_lowercase",
              "include_in_all": true
          },
          "MEDIA_ID": {
              "type": "long"
          },
          "MEDIA_PKEY": {
              "type": "string"
          },
          "PERFORMER": {
              "type": "string"
          },
          "PLAYER": {
              "type": "string"
          },
          "POSITION": {
              "type": "long"
          },
          "PRICE": {
              "type": "double"
          },
          "PRIORITY": {
              "type": "long"
          },
          "SHORTCODE": {
              "type": "string"
          },
          "SHORT_DESCRIPTION": {
              "type": "string"
          },
          "TYPE_ID": {
              "type": "long"
          },
          "VIEW_ID": {
              "type": "long"
          }
      }
    
    }
    }

I would like to know what is the reason and how i could fix it.
Thanks.

--
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/ad8740af-
2038-40d4-9fc2-79d6e1402e5a%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%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 a topic
in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/
cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%
3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%
40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBYhpWDHm-h-1rXFO%3DvHY0y4qkHdcHrR57nGEc0f1haAw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/c6d86b5e-52c9-479d-b2fa-78ef9f8bde0d%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 a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBefd__MOrWNUzHvTdkk8ZtMD1BxHAB26Cxz3k3OSYSAQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg9iuY_eHFO_VUywCQYB18FOWprT%3D9ZBDm4id8A0brq0Pw%40mail.gmail.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 a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBrN1ft3kG_L_LZ39KF-L1Y7hBsPFy%3D2ar64%3DqKe3ogLw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg8vUBhgDgnyhC_DT4PtwmGn4%3D6%2BCHpg9UrgnZNhgTEKig%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDubi%2Bf9W50UtMc4GJ2XpuoGSB7se0b7o31Zs6GKfLFZg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDubi%2Bf9W50UtMc4GJ2XpuoGSB7se0b7o31Zs6GKfLFZg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg_vm-nbt%3D%2BcysQ7WJc0LXan_hoF%3D%2BBLt%3DzC6H-dRVpYDQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg_vm-nbt%3D%2BcysQ7WJc0LXan_hoF%3D%2BBLt%3DzC6H-dRVpYDQ%40mail.gmail.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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/cwzQrR1Rpsw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAn5pTivuh4p5Qt-dUt0wtBMNWrBy80X81f_0Cu0hRAsQ%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAn5pTivuh4p5Qt-dUt0wtBMNWrBy80X81f_0Cu0hRAsQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,

Chee Hoo

--
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/CAGS0%2Bg_-kS3nn82h-rxZxVDMJREpZM5G8O0ygkc6_Onzm-98Ag%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGS0%2Bg_-kS3nn82h-rxZxVDMJREpZM5G8O0ygkc6_Onzm-98Ag%40mail.gmail.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%3DcQBn5ChmvF9grYpLNvZJ1_moW2VdHGL2imR3FCi2szn0%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.