davrob  
                (davrob)
               
                 
              
                  
                    May 24, 2011,  5:34pm
                   
                   
              1 
               
             
            
              Hi,
I have created a NativeScriptFactory: https://gist.github.com/989192 
Which I call using this snippet, which builds on an existing query 
that works fine: https://gist.github.com/989184 
But this is the error I get in the response: https://gist.github.com/989204 
This is my config where I associate the Factory with the name "my": 
  
  
    
sortQueryResponse.json 
{
  "took" : 125,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 2,
    "failed" : 3,
    "failures" : [ {
      "index" : "contactindex_2011_05_24_07_02_41",
      "shard" : 1, 
This file has been truncated. show original 
   
  
    
    
  
  
 
Any reason why I am getting the error?
Regards,
David.
             
            
               
               
               
            
            
           
          
            
              
                kimchy  
                (Shay Banon)
               
              
                  
                    May 24, 2011,  6:13pm
                   
                   
              2 
               
             
            
              You need to set the "lang" on the query builder to "native". Also, you probably want to use the docs lookup to fetch the field (all values loaded and cached to memory), compared with fields lookup, which fetches it if it was stored from the index storage. 
On Tuesday, May 24, 2011 at 8:34 PM, davrob2 wrote:
Hi,
I have created a NativeScriptFactory: NativeScriptFactory · GitHub 
Which I call using this snippet, which builds on an existing query 
that works fine: AddScriptSort_snippet · GitHub 
But this is the error I get in the response: sortQueryResponse.json · GitHub 
This is my config where I associate the Factory with the name "my": 
sortQueryResponse.json · GitHub 
Any reason why I am getting the error?
Regards,
David.
 
             
            
               
               
               
            
            
           
          
            
              
                Paul_Loy  
                (Paul Loy)
               
              
                  
                    May 24, 2011,  6:14pm
                   
                   
              3 
               
             
            
              Sorry, the config link is wrong. You posted the same link as the response 
link.
On Tue, May 24, 2011 at 6:34 PM, davrob2 daviroberts@gmail.com  wrote:
Hi,
I have created a NativeScriptFactory: NativeScriptFactory · GitHub 
Which I call using this snippet, which builds on an existing query 
that works fine: AddScriptSort_snippet · GitHub 
But this is the error I get in the response: 
sortQueryResponse.json · GitHub 
This is my config where I associate the Factory with the name "my": 
sortQueryResponse.json · GitHub 
Any reason why I am getting the error?
Regards,
David.
 
 -- 
Paul Loy 
paul@keteracel.com  
http://uk.linkedin.com/in/paulloy 
             
            
               
               
               
            
            
           
          
            
              
                davrob  
                (davrob)
               
              
                  
                    May 24, 2011,  6:47pm
                   
                   
              4 
               
             
            
              Apologies, this is the config link: script-config.yml · GitHub 
On May 24, 7:14 pm, Paul Loy ketera...@gmail.com  wrote:
Sorry, the config link is wrong. You posted the same link as the response 
link.
On Tue, May 24, 2011 at 6:34 PM, davrob2 davirobe...@gmail.com  wrote:
Hi,
 
I have created a NativeScriptFactory:NativeScriptFactory · GitHub 
 
Which I call using this snippet, which builds on an existing query 
that works fine:AddScriptSort_snippet · GitHub 
 
But this is the error I get in the response: 
sortQueryResponse.json · GitHub 
 
This is my config where I associate the Factory with the name "my": 
sortQueryResponse.json · GitHub 
 
Any reason why I am getting the error?
 
Regards,
 
David.
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy
 
             
            
               
               
               
            
            
           
          
            
              
                Paul_Loy  
                (Paul Loy)
               
              
                  
                    May 24, 2011,  7:06pm
                   
                   
              5 
               
             
            
              Shay was right, you also need a
script.native.my.lang: native
On Tue, May 24, 2011 at 7:47 PM, davrob2 daviroberts@gmail.com  wrote:
Apologies, this is the config link: script-config.yml · GitHub 
On May 24, 7:14 pm, Paul Loy ketera...@gmail.com  wrote:
Sorry, the config link is wrong. You posted the same link as the response 
link.
On Tue, May 24, 2011 at 6:34 PM, davrob2 davirobe...@gmail.com  wrote:
Hi,
 
I have created a NativeScriptFactory:NativeScriptFactory · GitHub 
 
Which I call using this snippet, which builds on an existing query 
that works fine:AddScriptSort_snippet · GitHub 
 
But this is the error I get in the response: 
sortQueryResponse.json · GitHub 
 
This is my config where I associate the Factory with the name "my": 
sortQueryResponse.json · GitHub 
 
Any reason why I am getting the error?
 
Regards,
 
David.
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy
 
 
 -- 
Paul Loy 
paul@keteracel.com  
http://uk.linkedin.com/in/paulloy 
             
            
               
               
               
            
            
           
          
            
              
                davrob  
                (davrob)
               
              
                  
                    May 24, 2011,  8:05pm
                   
                   
              6 
               
             
            
              Ok thanks for the help guys, I'm now getting a different exception 
(ClassCastException[org.elasticsearch.search.lookup.FieldLookup cannot 
be cast to java.lang.String]).
Response Error: sortQueryResponse.json · GitHub  
Factory: NativeScriptFactory · GitHub  
Config: script-config.yml · GitHub    - both the client node and 
the servier node have this, the server node includes the needed jars 
in its classpath. 
Query Builder: AddScriptSort_snippet · GitHub 
Regards,
David.
On May 24, 8:06 pm, Paul Loy ketera...@gmail.com  wrote:
Shay was right, you also need a
script.native.my.lang: native
On Tue, May 24, 2011 at 7:47 PM, davrob2 davirobe...@gmail.com  wrote:
Apologies, this is the config link:script-config.yml · GitHub 
 
On May 24, 7:14 pm, Paul Loy ketera...@gmail.com  wrote:
Sorry, the config link is wrong. You posted the same link as the response 
link.
 
 
On Tue, May 24, 2011 at 6:34 PM, davrob2 davirobe...@gmail.com  wrote:
Hi,
 
 
 
I have created a NativeScriptFactory:NativeScriptFactory · GitHub 
 
 
 
Which I call using this snippet, which builds on an existing query 
that works fine:AddScriptSort_snippet · GitHub 
 
 
 
But this is the error I get in the response: 
sortQueryResponse.json · GitHub 
 
 
 
This is my config where I associate the Factory with the name "my": 
sortQueryResponse.json · GitHub 
 
 
 
Any reason why I am getting the error?
 
 
 
Regards,
 
 
 
David.
 
 
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy
 
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy
 
             
            
               
               
               
            
            
           
          
            
              
                kimchy  
                (Shay Banon)
               
              
                  
                    May 24, 2011,  8:10pm
                   
                   
              7 
               
             
            
              Call either DocLookup#field or DocLookup#numeric (for numeric fields), you get back the correct class to work with. 
On Tuesday, May 24, 2011 at 11:05 PM, davrob2 wrote:
Ok thanks for the help guys, I'm now getting a different exception 
(ClassCastException[org.elasticsearch.search.lookup.FieldLookup cannot 
be cast to java.lang.String]).
Response Error: sortQueryResponse.json · GitHub  
Factory: NativeScriptFactory · GitHub  
Config: script-config.yml · GitHub  - both the client node and 
the servier node have this, the server node includes the needed jars 
in its classpath. 
Query Builder: AddScriptSort_snippet · GitHub 
Regards,
David.
On May 24, 8:06 pm, Paul Loy ketera...@gmail.com  wrote:
Shay was right, you also need a
script.native.my.lang: native
On Tue, May 24, 2011 at 7:47 PM, davrob2 davirobe...@gmail.com  wrote:
Apologies, this is the config link:script-config.yml · GitHub 
 
On May 24, 7:14 pm, Paul Loy ketera...@gmail.com  wrote:
Sorry, the config link is wrong. You posted the same link as the response 
link.
 
 
On Tue, May 24, 2011 at 6:34 PM, davrob2 davirobe...@gmail.com  wrote:
Hi,
 
 
 
I have created a NativeScriptFactory:NativeScriptFactory · GitHub 
 
 
 
Which I call using this snippet, which builds on an existing query 
that works fine:AddScriptSort_snippet · GitHub 
 
 
 
But this is the error I get in the response: 
sortQueryResponse.json · GitHub 
 
 
 
This is my config where I associate the Factory with the name "my": 
sortQueryResponse.json · GitHub 
 
 
 
Any reason why I am getting the error?
 
 
 
Regards,
 
 
 
David.
 
 
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy
 
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy
 
 
             
            
               
               
               
            
            
           
          
            
              
                nachiket  
                (nachiket)
               
              
                  
                    July 8, 2011,  6:28am
                   
                   
              8 
               
             
            
              Hi. I know this issue is resolved. But can somebody tell me what 
DocLookup#field means? 
Actually I am having same error and could not find any solution other 
than this.
Regards.
On May 25, 1:10 am, Shay Banon shay.ba...@elasticsearch.com  wrote:
Call either DocLookup#field or DocLookup#numeric (for numeric fields), you get back the correct class to work with.
On Tuesday, May 24, 2011 at 11:05 PM, davrob2 wrote:
Ok thanks for the help guys, I'm now getting a different exception 
(ClassCastException[org.elasticsearch.search.lookup.FieldLookup cannot 
be cast to java.lang.String]).
 
Response Error:sortQueryResponse.json · GitHub  
Factory:NativeScriptFactory · GitHub  
Config:https://gist.github.com/989191-  both the client node and 
the servier node have this, the server node includes the needed jars 
in its classpath. 
Query Builder:AddScriptSort_snippet · GitHub 
 
Regards,
 
David.
 
On May 24, 8:06 pm, Paul Loy ketera...@gmail.com  wrote:
Shay was right, you also need a
 
 
script.native.my.lang: native
 
 
On Tue, May 24, 2011 at 7:47 PM, davrob2 davirobe...@gmail.com  wrote:
Apologies, this is the config link:script-config.yml · GitHub 
 
 
 
On May 24, 7:14 pm, Paul Loy ketera...@gmail.com  wrote:
Sorry, the config link is wrong. You posted the same link as the response 
link.
 
 
 
 
On Tue, May 24, 2011 at 6:34 PM, davrob2 davirobe...@gmail.com  wrote:
Hi,
 
 
 
 
 
I have created a NativeScriptFactory:NativeScriptFactory · GitHub 
 
 
 
 
 
Which I call using this snippet, which builds on an existing query 
that works fine:AddScriptSort_snippet · GitHub 
 
 
 
 
 
But this is the error I get in the response: 
sortQueryResponse.json · GitHub 
 
 
 
 
 
This is my config where I associate the Factory with the name "my": 
sortQueryResponse.json · GitHub 
 
 
 
 
 
Any reason why I am getting the error?
 
 
 
 
 
Regards,
 
 
 
 
 
David.
 
 
 
 
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy
 
 
 
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy
 
 
 
             
            
               
               
               
            
            
           
          
            
              
                davrob  
                (davrob)
               
              
                  
                    July 14, 2011,  4:10pm
                   
                   
              9 
               
             
            
              This is what I ended up doing:
                     DocLookup doc = doc();
		 StringDocFieldData custAttField = doc.field("cusAttrIdValue");
		 String custAttrsStr = custAttField.getStringValue();
 
"cusAttrIdValue" is a non-analysed String field in my mapping.
David
On Jul 8, 7:28 am, nachiket bhagwat nachiketbhag...@gmail.com  wrote:
Hi. I know this issue is resolved. But can somebody tell me what 
DocLookup#field means? 
Actually I am having same error and could not find any solution other 
than this.
Regards.
On May 25, 1:10 am, Shay Banon shay.ba...@elasticsearch.com  wrote:
Call either DocLookup#field or DocLookup#numeric (for numeric fields), you get back the correct class to work with.
 
On Tuesday, May 24, 2011 at 11:05 PM, davrob2 wrote:
Ok thanks for the help guys, I'm now getting a different exception 
(ClassCastException[org.elasticsearch.search.lookup.FieldLookup cannot 
be cast to java.lang.String]).
 
 
Response Error:sortQueryResponse.json · GitHub  
Factory:NativeScriptFactory · GitHub  
Config:https://gist.github.com/989191-both  the client node and 
the servier node have this, the server node includes the needed jars 
in its classpath. 
Query Builder:AddScriptSort_snippet · GitHub 
 
 
Regards,
 
 
David.
 
 
On May 24, 8:06 pm, Paul Loy ketera...@gmail.com  wrote:
Shay was right, you also need a
 
 
 
script.native.my.lang: native
 
 
 
On Tue, May 24, 2011 at 7:47 PM, davrob2 davirobe...@gmail.com  wrote:
Apologies, this is the config link:script-config.yml · GitHub 
 
 
 
 
On May 24, 7:14 pm, Paul Loy ketera...@gmail.com  wrote:
Sorry, the config link is wrong. You posted the same link as the response 
link.
 
 
 
 
 
On Tue, May 24, 2011 at 6:34 PM, davrob2 davirobe...@gmail.com  wrote:
Hi,
 
 
 
 
 
 
I have created a NativeScriptFactory:NativeScriptFactory · GitHub 
 
 
 
 
 
 
Which I call using this snippet, which builds on an existing query 
that works fine:AddScriptSort_snippet · GitHub 
 
 
 
 
 
 
But this is the error I get in the response: 
sortQueryResponse.json · GitHub 
 
 
 
 
 
 
This is my config where I associate the Factory with the name "my": 
sortQueryResponse.json · GitHub 
 
 
 
 
 
 
Any reason why I am getting the error?
 
 
 
 
 
 
Regards,
 
 
 
 
 
 
David.
 
 
 
 
 
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy
 
 
 
 
 
-- 
Paul Loy 
p...@keteracel.comhttp ://uk.linkedin.com/in/paulloy