protected Response getMetadataLabel(final String label) {
StreamingOutput stream = new StreamingOutput()
{
@Override
public void write( OutputStream os ) throws IOException, WebApplicationException
{
try ( Transaction tx = database.beginTx() ) {
JsonGenerator jg = objectMapper.getFactory().createGenerator(os, JsonEncoding.UTF8);
IndexManager index = database.index();
Index<Node> metadata = index.forNodes("Metadatum");
jg.writeStartArray();
for ( Node metadatum : metadata.query( "label:"+label ) ) {
executor.writeField(metadatum, jg);
}
jg.writeEndArray();
jg.flush();
tx.success();
}
}
};
return Response.ok().entity( stream ).type( MediaType.APPLICATION_JSON ).build();
}
MetadatumSearcher.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:WhiteLab2.0-Neo4J-Plugin
作者:
评论列表
文章目录