use of org.apache.atlas.repository.graphdb.AtlasIndexQuery in project incubator-atlas by apache.
the class EntityDiscoveryService method searchUsingFullTextQuery.
@Override
public AtlasSearchResult searchUsingFullTextQuery(String fullTextQuery, boolean excludeDeletedEntities, int limit, int offset) throws AtlasBaseException {
AtlasSearchResult ret = new AtlasSearchResult(fullTextQuery, AtlasQueryType.FULL_TEXT);
QueryParams params = validateSearchParams(limit, offset);
AtlasIndexQuery idxQuery = toAtlasIndexQuery(fullTextQuery);
if (LOG.isDebugEnabled()) {
LOG.debug("Executing Full text query: {}", fullTextQuery);
}
ret.setFullTextResult(getIndexQueryResults(idxQuery, params, excludeDeletedEntities));
return ret;
}
use of org.apache.atlas.repository.graphdb.AtlasIndexQuery in project incubator-atlas by apache.
the class GraphRepoMapperScaleTest method searchWithIndex.
private void searchWithIndex(String key, String value) {
AtlasGraph graph = TestUtils.getGraph();
long start = System.currentTimeMillis();
int count = 0;
try {
String queryString = "v.\"" + key + "\":(" + value + ")";
AtlasIndexQuery query = graph.indexQuery(Constants.VERTEX_INDEX, queryString);
Iterator<AtlasIndexQuery.Result> result = query.vertices();
while (result.hasNext()) {
result.next();
count++;
}
} finally {
System.out.println("Search on [" + key + "=" + value + "] returned results: " + count + ", took " + (System.currentTimeMillis() - start) + " ms");
}
}
Aggregations