public Response getElementsFromIndexRexsterTypedJson(@PathParam("graphname") final String graphName, @PathParam("indexName") final String indexName) {
return this.getElementsFromIndex(graphName, indexName, true);
}
private Response getElementsFromIndex(final String graphName, final String indexName, final boolean showTypes) {
final Index index = this.getIndexFromGraph(graphName, indexName);
final RexsterApplicationGraph rag = this.getRexsterApplicationGraph(graphName);
String key = null;
Object value = null;
final JSONObject theRequestObject = this.getRequestObject();
Object temp = theRequestObject.opt(Tokens.KEY);
if (null != temp)
key = temp.toString();
temp = theRequestObject.opt(Tokens.VALUE);
if (null != temp)
value = ElementHelper.getTypedPropertyValue(temp.toString());
final Long start = RequestObjectHelper.getStartOffset(theRequestObject);
final Long end = RequestObjectHelper.getEndOffset(theRequestObject);
final Set<String> returnKeys = RequestObjectHelper.getReturnKeys(theRequestObject);
final GraphSONMode mode = showTypes ? GraphSONMode.EXTENDED : GraphSONMode.NORMAL;
long counter = 0l;
if (null != index && key != null && value != null) {
final CloseableIterable<Element> indexElements = (CloseableIterable<Element>) index.get(key, value);
try {
final JSONArray elementArray = new JSONArray();
for (Element element : indexElements) {
if (counter >= start && counter < end) {