Skip to content

[DE-379] Arangosearch updates for 3.10 #456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/main/java/com/arangodb/ArangoCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,16 @@ <T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(
*/
IndexEntity ensurePersistentIndex(Iterable<String> fields, PersistentIndexOptions options) throws ArangoDBException;

/**
* Creates an inverted index for the collection, if it does not already exist.
*
* @param options index creation options
* @return information about the index
* @throws ArangoDBException
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-inverted.html">API Documentation</a>
*/
Object ensureInvertedIndex(InvertedIndexOptions options) throws ArangoDBException;

/**
* Creates a geo-spatial index for the collection, if it does not already exist.
*
Expand All @@ -519,7 +529,7 @@ <T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(
* @throws ArangoDBException
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-fulltext.html#create-fulltext-index">API
* Documentation</a>
* @deprecated since ArangoDB 3.10, use ArangoSearch view instead.
* @deprecated since ArangoDB 3.10, use ArangoSearch or Inverted indexes instead.
*/
@Deprecated
IndexEntity ensureFulltextIndex(Iterable<String> fields, FulltextIndexOptions options) throws ArangoDBException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ CompletableFuture<IndexEntity> ensurePersistentIndex(
* @return information about the index
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-fulltext.html#create-fulltext-index">API
* Documentation</a>
* @deprecated since ArangoDB 3.10, use ArangoSearch view instead.
* @deprecated since ArangoDB 3.10, use ArangoSearch or Inverted indexes instead.
*/
@Deprecated
CompletableFuture<IndexEntity> ensureFulltextIndex(
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/arangodb/entity/IndexType.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public enum IndexType {
geo2,

/**
* @deprecated since ArangoDB 3.10, use ArangoSearch view instead.
* @deprecated since ArangoDB 3.10, use ArangoSearch or Inverted indexes instead.
*/
@Deprecated
fulltext,
Expand All @@ -50,5 +50,10 @@ public enum IndexType {

ttl,

zkd
zkd,

/**
* @since ArangoDB 3.10
*/
inverted
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ public enum AnalyzerFeature {
norm,

/**
* sequentially increasing term position, required for PHRASE(). If present then the frequency feature is also required
* sequentially increasing term position, required for PHRASE(). If present then the frequency feature is also required.
*/
position
position,

/**
* enable search highlighting capabilities (Enterprise Edition only). If present, then the `position` and `frequency` features are also required.
* @since ArangoDB 3.10
*/
offset

}
5 changes: 5 additions & 0 deletions src/main/java/com/arangodb/internal/ArangoCollectionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ public IndexEntity ensurePersistentIndex(final Iterable<String> fields, final Pe
return executor.execute(createPersistentIndexRequest(fields, options), IndexEntity.class);
}

@Override
public Object ensureInvertedIndex(final InvertedIndexOptions options) throws ArangoDBException {
return executor.execute(createInvertedIndexRequest(options), Object.class);
}

@Override
public IndexEntity ensureGeoIndex(final Iterable<String> fields, final GeoIndexOptions options)
throws ArangoDBException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,13 @@ protected Request createPersistentIndexRequest(
return request;
}

protected Request createInvertedIndexRequest(final InvertedIndexOptions options) {
final Request request = request(db.dbName(), RequestType.POST, PATH_API_INDEX);
request.putQueryParam(COLLECTION, name);
request.setBody(util().serialize(options));
return request;
}

protected Request createGeoIndexRequest(final Iterable<String> fields, final GeoIndexOptions options) {
final Request request = request(db.dbName(), RequestType.POST, PATH_API_INDEX);
request.putQueryParam(COLLECTION, name);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/arangodb/model/FulltextIndexOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @author Mark Vollmary
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-fulltext.html#create-fulltext-index">API
* Documentation</a>
* @deprecated since ArangoDB 3.10, use ArangoSearch view instead.
* @deprecated since ArangoDB 3.10, use ArangoSearch or Inverted indexes instead.
*/
@Deprecated
public class FulltextIndexOptions extends IndexOptions<FulltextIndexOptions> {
Expand Down
Loading