public abstract class QueryBase extends Object implements Query, SimilarToGraphQuery
| Modifier and Type | Class and Description |
|---|---|
static class |
QueryBase.HasAuthorizationContainer |
static class |
QueryBase.HasContainer |
static class |
QueryBase.HasExtendedData |
static class |
QueryBase.HasNotPropertyContainer |
static class |
QueryBase.HasPropertyContainer |
static class |
QueryBase.HasValueContainer |
static class |
QueryBase.PropertySortContainer |
static interface |
QueryBase.SortContainer |
static class |
QueryBase.SortingStrategySortContainer |
| Modifier | Constructor and Description |
|---|---|
protected |
QueryBase(Graph graph,
String[] similarToFields,
String similarToText,
Authorizations authorizations) |
protected |
QueryBase(Graph graph,
String queryString,
Authorizations authorizations) |
protected |
QueryBase(Graph graph,
String queryString,
String logicalQuery,
Authorizations authorizations) |
| Modifier and Type | Method and Description |
|---|---|
Query |
addAggregation(Aggregation aggregation)
Add an aggregation to the query
|
SimilarToGraphQuery |
boost(float boost)
The amount of boost to apply to the similarity query.
|
QueryResultsIterable<String> |
edgeIds()
Execute the query and return the ids of all matching edges.
|
QueryResultsIterable<String> |
edgeIds(EnumSet<IdFetchHint> idFetchHints)
Execute the query and return the ids of all matching edges.
|
QueryResultsIterable<Edge> |
edges() |
QueryResultsIterable<Edge> |
edges(FetchHints fetchHints) |
QueryResultsIterable<Edge> |
edges(String label)
Deprecated.
|
QueryResultsIterable<Edge> |
edges(String label,
FetchHints fetchHints)
Deprecated.
|
QueryResultsIterable<String> |
elementIds()
Execute the query and return the ids of all matching elements.
|
QueryResultsIterable<String> |
elementIds(EnumSet<IdFetchHint> idFetchHints)
Execute the query and return the ids of all matching elements.
|
QueryResultsIterable<Element> |
elements() |
QueryResultsIterable<Element> |
elements(FetchHints fetchHints) |
protected QueryResultsIterable<? extends GeObject> |
extendedData(FetchHints fetchHints)
This method should be overridden if
search(EnumSet, FetchHints) is not overridden. |
protected QueryResultsIterable<? extends GeObject> |
extendedData(FetchHints fetchHints,
Iterable<? extends Element> elements) |
QueryResultsIterable<ExtendedDataRowId> |
extendedDataRowIds()
Execute the query and return the ids of all matching extended data rows.
|
QueryResultsIterable<ExtendedDataRowId> |
extendedDataRowIds(EnumSet<IdFetchHint> idFetchHints)
Execute the query and return the ids of all matching extended data rows.
|
QueryResultsIterable<ExtendedDataRow> |
extendedDataRows() |
QueryResultsIterable<ExtendedDataRow> |
extendedDataRows(FetchHints fetchHints) |
Aggregation |
getAggregationByName(String aggregationName) |
Collection<Aggregation> |
getAggregations()
Gets the added aggregations
|
Graph |
getGraph() |
String |
getLogicalQuery() |
QueryParameters |
getParameters() |
<T extends Value> |
has(Class<T> dataType)
Adds a has filter to the query.
|
<T extends Value,K extends Value> |
has(Class<T> dataType,
Predicate predicate,
K value)
Adds a filter to the query.
|
<T> Query |
has(Iterable<String> propertyNames)
Adds a filter to the query.
|
<T extends Value> |
has(Iterable<String> propertyNames,
Predicate predicate,
T value)
Adds a filter to the query.
|
Query |
has(String propertyName)
Adds a has filter to the query.
|
<T extends Value> |
has(String propertyName,
Predicate predicate,
Conjunction conjunction,
T value)
Adds a filter to the query.
|
<T extends Value> |
has(String propertyName,
Predicate predicate,
T value)
Adds a filter to the query.
|
<T extends Value> |
has(String propertyName,
T value)
Adds an
Compare.EQUAL filter to the query. |
Query |
hasAuthorization(Iterable<String> authorizations)
Adds an authorization filter to the query.
|
Query |
hasAuthorization(String... authorizations)
Adds an authorization filter to the query.
|
Query |
hasConceptType(Collection<String> conceptTypes) |
Query |
hasConceptType(String... conceptTypes) |
Query |
hasEdgeLabel(Collection<String> edgeLabels)
Adds a edge label filter to the query.
|
Query |
hasEdgeLabel(String... edgeLabels)
Adds a edge label filter to the query.
|
Query |
hasExtendedData(ElementType elementType,
String elementId)
Adds a extended data element filter to the query.
|
Query |
hasExtendedData(ElementType elementType,
String elementId,
String tableName)
Adds a extended data element filter to the query.
|
Query |
hasExtendedData(Iterable<HasExtendedDataFilter> filters)
Adds a multiple extended data element filter to the query.
|
Query |
hasExtendedData(String tableName)
Adds a extended data table filter to the query.
|
Query |
hasId(Iterable<String> ids)
Adds an id filter to the query.
|
Query |
hasId(String... ids)
Adds an id filter to the query.
|
Query |
hasInVertexTypes(String... vertexTypes) |
<T extends Value> |
hasNot(Class<T> dataType)
Adds a hasNot filter to the query.
|
<T> Query |
hasNot(Iterable<String> propertyNames)
Adds a filter to the query.
|
Query |
hasNot(String propertyName)
Adds a hasNot filter to the query.
|
<T extends Value> |
hasNot(String propertyName,
T value)
Adds an
Contains.NOT_IN filter to the query. |
Query |
hasOutVertexTypes(String... vertexTypes) |
protected FetchHints |
idFetchHintsToElementFetchHints(EnumSet<IdFetchHint> idFetchHints) |
boolean |
isAggregationSupported(Aggregation aggregation)
Test to see if aggregation is supported.
|
Query |
limit(Integer count)
Limits the number of items returned.
|
Query |
limit(Long count)
Limits the number of items returned.
|
SimilarToGraphQuery |
maxDocFrequency(int maxDocFrequency)
The maximum number of documents a term can be in to be considered for a similarity match.
|
SimilarToGraphQuery |
maxQueryTerms(int maxQueryTerms)
The maximum number of terms to be searched for.
|
SimilarToGraphQuery |
minDocFrequency(int minDocFrequency)
The minimum number of documents a term must be in to be considered for a similarity match.
|
Query |
minScore(double score)
Minimum score to return
|
SimilarToGraphQuery |
minTermFrequency(int minTermFrequency)
The minimum number of times a term must appear in the source data to be considered for a match.
|
<T extends Value> |
range(String propertyName,
T startValue,
boolean inclusiveStartValue,
T endValue,
boolean inclusiveEndValue)
Queries for properties in the given range.
|
<T extends Value> |
range(String propertyName,
T startValue,
T endValue)
Queries for properties in the given range.
|
Query |
scoringStrategy(ScoringStrategy scoringStrategy)
Sets the scoring strategy for this query
|
QueryResultsIterable<? extends GeObject> |
search() |
QueryResultsIterable<? extends GeObject> |
search(EnumSet<GeObjectType> objectTypes,
FetchHints fetchHints) |
void |
setLogicalQuery(String logicalQuery) |
Query |
setShard(String shardId) |
Query |
skip(int count)
Skips the given number of items.
|
Query |
sort(SortingStrategy sortingStrategy,
SortDirection direction)
Sort the results by the given
SortingStrategy. |
Query |
sort(String propertyName,
SortDirection direction)
Sort the results by the given property name.
|
String |
toString() |
QueryResultsIterable<String> |
vertexIds()
Execute the query and return the ids of all matching vertices.
|
QueryResultsIterable<String> |
vertexIds(EnumSet<IdFetchHint> idFetchHints)
Execute the query and return the ids of all matching vertices.
|
QueryResultsIterable<Vertex> |
vertices() |
QueryResultsIterable<Vertex> |
vertices(FetchHints fetchHints) |
protected QueryBase(Graph graph, String queryString, String logicalQuery, Authorizations authorizations)
protected QueryBase(Graph graph, String queryString, Authorizations authorizations)
protected QueryBase(Graph graph, String[] similarToFields, String similarToText, Authorizations authorizations)
public String getLogicalQuery()
public void setLogicalQuery(String logicalQuery)
public QueryResultsIterable<Vertex> vertices()
public QueryResultsIterable<Vertex> vertices(FetchHints fetchHints)
public QueryResultsIterable<String> vertexIds()
Querypublic QueryResultsIterable<String> vertexIds(EnumSet<IdFetchHint> idFetchHints)
Querypublic QueryResultsIterable<Edge> edges()
public QueryResultsIterable<Edge> edges(FetchHints fetchHints)
public QueryResultsIterable<String> edgeIds()
Querypublic QueryResultsIterable<String> edgeIds(EnumSet<IdFetchHint> idFetchHints)
Querypublic QueryResultsIterable<ExtendedDataRow> extendedDataRows()
extendedDataRows in interface Querypublic QueryResultsIterable<ExtendedDataRow> extendedDataRows(FetchHints fetchHints)
extendedDataRows in interface Querypublic QueryResultsIterable<ExtendedDataRowId> extendedDataRowIds()
QueryextendedDataRowIds in interface Querypublic QueryResultsIterable<ExtendedDataRowId> extendedDataRowIds(EnumSet<IdFetchHint> idFetchHints)
QueryextendedDataRowIds in interface QueryidFetchHints - Details about which data to fetch.public QueryResultsIterable<? extends GeObject> search()
public QueryResultsIterable<? extends GeObject> search(EnumSet<GeObjectType> objectTypes, FetchHints fetchHints)
protected QueryResultsIterable<? extends GeObject> extendedData(FetchHints fetchHints)
search(EnumSet, FetchHints) is not overridden.protected QueryResultsIterable<? extends GeObject> extendedData(FetchHints fetchHints, Iterable<? extends Element> elements)
public Query hasId(String... ids)
Querypublic Query hasId(Iterable<String> ids)
Querypublic Query hasConceptType(String... conceptTypes)
hasConceptType in interface Querypublic Query hasConceptType(Collection<String> conceptTypes)
hasConceptType in interface Querypublic Query hasEdgeLabel(String... edgeLabels)
QueryhasEdgeLabel in interface QueryedgeLabels - The edge labels to filter on.public Query hasEdgeLabel(Collection<String> edgeLabels)
QueryhasEdgeLabel in interface QueryedgeLabels - The edge labels to filter on.public Query hasAuthorization(String... authorizations)
QueryhasAuthorization in interface Queryauthorizations - An element will match if it or any of its properties use one of the specified authorizations.public Query hasAuthorization(Iterable<String> authorizations)
QueryhasAuthorization in interface Queryauthorizations - An element will match if it or any of its properties use one of the specified authorizations.public Query hasExtendedData(ElementType elementType, String elementId)
QueryhasExtendedData in interface QueryelementType - The type of element.elementId - The element idpublic Query hasExtendedData(String tableName)
QueryhasExtendedData in interface QuerytableName - The table namepublic Query hasExtendedData(ElementType elementType, String elementId, String tableName)
QueryhasExtendedData in interface QueryelementType - The type of element. null to search all element types.elementId - The element id. null to search all elements.tableName - The table name. null to search all tables.public Query hasExtendedData(Iterable<HasExtendedDataFilter> filters)
QueryhasExtendedData in interface Queryfilters - The list of filters to be or'ed together.@Deprecated public QueryResultsIterable<Edge> edges(String label, FetchHints fetchHints)
@Deprecated public QueryResultsIterable<Edge> edges(String label)
public QueryResultsIterable<Element> elements()
public QueryResultsIterable<Element> elements(FetchHints fetchHints)
public QueryResultsIterable<String> elementIds()
QueryelementIds in interface Querypublic QueryResultsIterable<String> elementIds(EnumSet<IdFetchHint> idFetchHints)
QueryelementIds in interface Querypublic <T extends Value> Query range(String propertyName, T startValue, T endValue)
Querypublic <T extends Value> Query range(String propertyName, T startValue, boolean inclusiveStartValue, T endValue, boolean inclusiveEndValue)
Querypublic Query sort(String propertyName, SortDirection direction)
Querypublic Query sort(SortingStrategy sortingStrategy, SortDirection direction)
QuerySortingStrategy.sort in interface QuerysortingStrategy - The SortingStrategy to sort by.direction - The direction to sort.public <T extends Value> Query has(String propertyName, T value)
QueryCompare.EQUAL filter to the query.public <T extends Value> Query hasNot(String propertyName, T value)
QueryContains.NOT_IN filter to the query.public <T extends Value> Query has(String propertyName, Predicate predicate, T value)
Queryhas in interface QuerypropertyName - The name of the property to query on.predicate - One of Compare,
TextPredicate,
or GeoCompare.value - The value of the property to query for.public <T extends Value> Query has(String propertyName, Predicate predicate, Conjunction conjunction, T value)
Queryhas in interface QuerypropertyName - The name of the property to query on.predicate - One of Compare,
TextPredicate,
or GeoCompare.conjunction - AND/ORvalue - The value of the property to query for.public <T extends Value,K extends Value> Query has(Class<T> dataType, Predicate predicate, K value)
Queryhas in interface QuerydataType - All properties with a matching datatype will be queried on. A match in any of the selected properties will cause a document to match.predicate - One of Compare,
TextPredicate,
or GeoCompare.value - The value of the property to query for.public <T extends Value> Query has(Class<T> dataType)
Querypublic <T extends Value> Query hasNot(Class<T> dataType)
Querypublic <T extends Value> Query has(Iterable<String> propertyNames, Predicate predicate, T value)
Queryhas in interface QuerypropertyNames - All properties to query on. A match in any of the given properties will cause a document to match.predicate - One of Compare,
TextPredicate,
or GeoCompare.value - The value of the property to query for.public Query has(String propertyName)
Querypublic <T> Query has(Iterable<String> propertyNames)
Querypublic Query hasNot(String propertyName)
Querypublic <T> Query hasNot(Iterable<String> propertyNames)
Querypublic Query skip(int count)
Querypublic Query limit(Integer count)
Querypublic Query limit(Long count)
Querypublic Query minScore(double score)
Querypublic Query scoringStrategy(ScoringStrategy scoringStrategy)
QueryscoringStrategy in interface Querypublic Graph getGraph()
public QueryParameters getParameters()
public SimilarToGraphQuery minTermFrequency(int minTermFrequency)
SimilarToGraphQueryminTermFrequency in interface SimilarToGraphQuerypublic SimilarToGraphQuery maxQueryTerms(int maxQueryTerms)
SimilarToGraphQuerymaxQueryTerms in interface SimilarToGraphQuerypublic SimilarToGraphQuery minDocFrequency(int minDocFrequency)
SimilarToGraphQueryminDocFrequency in interface SimilarToGraphQuerypublic SimilarToGraphQuery maxDocFrequency(int maxDocFrequency)
SimilarToGraphQuerymaxDocFrequency in interface SimilarToGraphQuerypublic SimilarToGraphQuery boost(float boost)
SimilarToGraphQueryboost in interface SimilarToGraphQuerypublic boolean isAggregationSupported(Aggregation aggregation)
QueryisAggregationSupported in interface Queryaggregation - the aggregation to test.public Query addAggregation(Aggregation aggregation)
QueryaddAggregation in interface Queryaggregation - the aggregation to add.public Collection<Aggregation> getAggregations()
QuerygetAggregations in interface Querypublic Aggregation getAggregationByName(String aggregationName)
protected FetchHints idFetchHintsToElementFetchHints(EnumSet<IdFetchHint> idFetchHints)
Copyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.