Hi,
We have groovy code like this
public IndexType getType(Index index, String typeName) {
if (index == null || typeName == null) {
throw new SearchException("Index or type name provided was
null!")
}
IndexType returnType = index.indexTypes.find {
it.name == typeName
}
return returnType
}
But now getting stacktraces like
2010-11-15 14:12:57,300 [http-8083-1] ERROR
errors.GrailsExceptionResolver - Could not find matching constructor
for: org.elasticsearch.search.SearchException(java.lang.String)
groovy.lang.GroovyRuntimeException: Could not find matching
constructor for:
org.elasticsearch.search.SearchException(java.lang.String)
at
com.ticketfly.search.SearchQueryService.getType(SearchQueryService.groovy:
283)
at com.ticketfly.search.SearchQueryService$getType.call(Unknown
Source)
Looking at the method sigs, its asking for a ShardTarget
How does once quickly create a ShardTarget programmatically (from w/in
the code)
package org.elasticsearch.search;
public static class SearchException extends
org.elasticsearch.ElasticSearchException {
private final org.elasticsearch.search.SearchShardTarget
shardTarget;
public SearchException(org.elasticsearch.search.SearchShardTarget
shardTarget, java.lang.String msg) { /* compiled code */ }
public SearchException(org.elasticsearch.search.SearchShardTarget
shardTarget, java.lang.String msg, java.lang.Throwable cause) { /*
compiled code */ }
public org.elasticsearch.search.SearchShardTarget shard() { /*
compiled code */ }
}
Seems like ShardTarget asks for a few things
public static class SearchShardTarget implements
org.elasticsearch.common.io.stream.Streamable, java.io.Serializable{
private java.lang.String nodeId;
private java.lang.String index;
private int shardId;
private SearchShardTarget() { /* compiled code */ }
public SearchShardTarget(java.lang.String nodeId, java.lang.String
index, int shardId) { /* compiled code */ }
Thanks
G