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

2014-04-29 Thread chee hoo lum
>
>>>>
>>>> On Tue, Apr 29, 2014 at 12:16 AM, Ivan Brusic  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 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
>>>>>>> https://gist.github.com/cheehoo/11327970
>>>>>>>
>>>>>>> full index mapping
>>>>>>> https://gist.github.com/cheehoo/11327996
>>>>>>>
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic 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 wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I am trying to query some records via the span_first query as
>>>>>>>>> below :
>>>>>>>>>
>>>>>>>>> {
>>>>>>>>>  "from" : 100,
>>>>>>>>>  "size" : 100,
>>>>>>>>>  "query" : {
>>>>&g

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

2014-04-29 Thread Ivan Brusic
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
>>>>>> https://gist.github.com/cheehoo/11327970
>>>>>>
>>>>>> full index mapping
>>>>>> https://gist.github.com/cheehoo/11327996
>>>>>>
>>>>>> Thanks in advance.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic  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 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)];
>>>>>>>> "*
>>>>>>>> }
>>>>>>>>
>>>

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

2014-04-29 Thread chee hoo lum
>>>> 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
>>>>> https://gist.github.com/cheehoo/11327970
>>>>>
>>>>> full index mapping
>>>>> https://gist.github.com/cheehoo/11327996
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic  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 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"
>>>

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

2014-04-29 Thread Ivan Brusic
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  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  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 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
>>>> https://gist.github.com/cheehoo/11327970
>>>>
>>>> full index mapping
>>>> https://gist.github.com/cheehoo/11327996
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic  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
>>>>>
>>>>>
>>>>>
>>&

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

2014-04-28 Thread chee hoo lum
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  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  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
>>> https://gist.github.com/cheehoo/11327970
>>>
>>> full index mapping
>>> https://gist.github.com/cheehoo/11327996
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>>
>>>
>>> On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic  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 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
>>>>> }
>>>>>}
>>>>> }
>>>>>
>&g

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

2014-04-28 Thread Ivan Brusic
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  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
>> https://gist.github.com/cheehoo/11327970
>>
>> full index mapping
>> https://gist.github.com/cheehoo/11327996
>>
>> Thanks in advance.
>>
>>
>>
>>
>>
>> On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic  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  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

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

2014-04-27 Thread cyrilforce
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
> https://gist.github.com/cheehoo/11327970
>
> full index mapping
> https://gist.github.com/cheehoo/11327996
>
> Thanks in advance.
>
>
>
>
>
> On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic  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  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"
>>> },
>>>   *  "

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

2014-04-26 Thread chee hoo lum
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
https://gist.github.com/cheehoo/11327970

full index mapping
https://gist.github.com/cheehoo/11327996

Thanks in advance.





On Sat, Apr 26, 2014 at 8:31 AM, Ivan Brusic  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  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
>>   

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

2014-04-25 Thread Ivan Brusic
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  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"
> },
>

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

2014-04-25 Thread cyrilforce
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+unsubscr...@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.