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 <[email protected]> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/ad8740af-2038-40d4-9fc2-79d6e1402e5a%40googlegroups.com<https://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 [email protected].
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.

Reply via email to