|
| 1 | +# ArangoSearch API |
| 2 | + |
| 3 | +These functions implement the |
| 4 | +[HTTP API for ArangoSearch views](https://docs.arangodb.com/latest/HTTP/Views/ArangoSearch.html). |
| 5 | + |
| 6 | +## ArangoDatabase.createArangoSearch |
| 7 | + |
| 8 | +``` |
| 9 | +ArangoDatabase.createArangoSearch(String name, ArangoSearchCreateOptions options) : ViewEntity |
| 10 | +``` |
| 11 | + |
| 12 | +Creates a ArangoSearch view with the given _options_, then returns view information from the server. |
| 13 | + |
| 14 | +**Arguments** |
| 15 | + |
| 16 | +- **name**: `String` |
| 17 | + |
| 18 | + The name of the view |
| 19 | + |
| 20 | +- **options**: `ArangoSearchCreateOptions` |
| 21 | + |
| 22 | + - **locale**: `String` |
| 23 | + |
| 24 | + The default locale used for queries on analyzed string values (default: C). |
| 25 | + |
| 26 | + - **commitIntervalMsec**: `Long` |
| 27 | + |
| 28 | + Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, to disable use: 0). For the case where there are a lot of inserts/updates, a lower value, until commit, will cause the index not to account for them and memory usage would continue to grow. For the case where there are a few inserts/updates, a higher value will impact performance and waste disk space for each commit call without any added benefits. |
| 29 | + |
| 30 | + - **cleanupIntervalStep**: `Long` |
| 31 | + |
| 32 | + Wait at least this many commits between removing unused files in data directory (default: 10, to disable use: 0). For the case where the consolidation policies merge segments often (i.e. a lot of commit+consolidate), a lower value will cause a lot of disk space to be wasted. For the case where the consolidation policies rarely merge segments (i.e. few inserts/deletes), a higher value will impact performance without any added benefits. |
| 33 | + |
| 34 | + - **threshold**: `ConsolidateThreshold[]` |
| 35 | + |
| 36 | + A list of consolidate thresholds |
| 37 | + |
| 38 | +**Examples** |
| 39 | + |
| 40 | +```Java |
| 41 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 42 | +ArangoDatabase db = arango.db("myDB"); |
| 43 | +db.createArangoSearch("potatos", new ArangoSearchPropertiesOptions()); |
| 44 | +// the ArangoSearch view "potatos" now exists |
| 45 | +``` |
| 46 | + |
| 47 | +## ArangoSearch.create |
| 48 | + |
| 49 | +``` |
| 50 | +ArangoSearch.create(ArangoSearchCreateOptions options) : ViewEntity |
| 51 | +``` |
| 52 | + |
| 53 | +Creates a ArangoSearch view with the given _options_, then returns view information from the server. |
| 54 | + |
| 55 | +Alternative for [ArangoDatabase.createArangoSearch](#arangodatabasecreatearangosearch). |
| 56 | + |
| 57 | +**Arguments** |
| 58 | + |
| 59 | +- **options**: `ArangoSearchCreateOptions` |
| 60 | + |
| 61 | + - **locale**: `String` |
| 62 | + |
| 63 | + The default locale used for queries on analyzed string values (default: C). |
| 64 | + |
| 65 | + - **commitIntervalMsec**: `Long` |
| 66 | + |
| 67 | + Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, to disable use: 0). For the case where there are a lot of inserts/updates, a lower value, until commit, will cause the index not to account for them and memory usage would continue to grow. For the case where there are a few inserts/updates, a higher value will impact performance and waste disk space for each commit call without any added benefits. |
| 68 | + |
| 69 | + - **cleanupIntervalStep**: `Long` |
| 70 | + |
| 71 | + Wait at least this many commits between removing unused files in data directory (default: 10, to disable use: 0). For the case where the consolidation policies merge segments often (i.e. a lot of commit+consolidate), a lower value will cause a lot of disk space to be wasted. For the case where the consolidation policies rarely merge segments (i.e. few inserts/deletes), a higher value will impact performance without any added benefits. |
| 72 | + |
| 73 | + - **threshold**: `ConsolidateThreshold[]` |
| 74 | + |
| 75 | + A list of consolidate thresholds |
| 76 | + |
| 77 | +**Examples** |
| 78 | + |
| 79 | +```Java |
| 80 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 81 | +ArangoDatabase db = arango.db("myDB"); |
| 82 | +ArangoSearch view = db.arangoSearch("potatos"); |
| 83 | + |
| 84 | +view.create(new ArangoSearchPropertiesOptions()); |
| 85 | +// the ArangoSearch view "potatos" now exists |
| 86 | +``` |
| 87 | + |
| 88 | +## ArangoSearch.getProperties |
| 89 | + |
| 90 | +``` |
| 91 | +ArangoSearch.getProperties() : ArangoSearchPropertiesEntity |
| 92 | +``` |
| 93 | + |
| 94 | +Reads the properties of the specified view. |
| 95 | + |
| 96 | +**Examples** |
| 97 | + |
| 98 | +```Java |
| 99 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 100 | +ArangoDatabase db = arango.db("myDB"); |
| 101 | +ArangoSearch view = db.arangoSearch("potatos"); |
| 102 | + |
| 103 | +ArangoSearchPropertiesEntity properties = view.getProperties(); |
| 104 | +``` |
| 105 | + |
| 106 | +## ArangoSearch.updateProperties |
| 107 | + |
| 108 | +``` |
| 109 | +ArangoSearch.updateProperties(ArangoSearchPropertiesOptions options) : ArangoSearchPropertiesEntity |
| 110 | +``` |
| 111 | + |
| 112 | +Partially changes properties of the view. |
| 113 | + |
| 114 | +**Arguments** |
| 115 | + |
| 116 | +- **options**: `ArangoSearchPropertiesOptions` |
| 117 | + |
| 118 | + - **locale**: `String` |
| 119 | + |
| 120 | + The default locale used for queries on analyzed string values (default: C). |
| 121 | + |
| 122 | + - **commitIntervalMsec**: `Long` |
| 123 | + |
| 124 | + Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, to disable use: 0). For the case where there are a lot of inserts/updates, a lower value, until commit, will cause the index not to account for them and memory usage would continue to grow. For the case where there are a few inserts/updates, a higher value will impact performance and waste disk space for each commit call without any added benefits. |
| 125 | + |
| 126 | + - **cleanupIntervalStep**: `Long` |
| 127 | + |
| 128 | + Wait at least this many commits between removing unused files in data directory (default: 10, to disable use: 0). For the case where the consolidation policies merge segments often (i.e. a lot of commit+consolidate), a lower value will cause a lot of disk space to be wasted. For the case where the consolidation policies rarely merge segments (i.e. few inserts/deletes), a higher value will impact performance without any added benefits. |
| 129 | + |
| 130 | + - **threshold**: `ConsolidateThreshold[]` |
| 131 | + |
| 132 | + A list of consolidate thresholds |
| 133 | + |
| 134 | + - **link**: `CollectionLink[]` |
| 135 | + |
| 136 | + A list of linked collections |
| 137 | + |
| 138 | +**Examples** |
| 139 | + |
| 140 | +```Java |
| 141 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 142 | +ArangoDatabase db = arango.db("myDB"); |
| 143 | +ArangoSearch view = db.arangoSearch("some-view"); |
| 144 | + |
| 145 | +view.updateProperties(new ArangoSearchPropertiesOptions().link(CollectionLink.on("myCollection").fields(FieldLink.on("value").analyzers("identity")))); |
| 146 | +``` |
| 147 | + |
| 148 | +## ArangoSearch.replaceProperties |
| 149 | + |
| 150 | +``` |
| 151 | +ArangoSearch.replaceProperties(ArangoSearchPropertiesOptions options) : ArangoSearchPropertiesEntity |
| 152 | +``` |
| 153 | + |
| 154 | +Changes properties of the view. |
| 155 | + |
| 156 | +**Arguments** |
| 157 | + |
| 158 | +- **options**: `ArangoSearchPropertiesOptions` |
| 159 | + |
| 160 | + - **locale**: `String` |
| 161 | + |
| 162 | + The default locale used for queries on analyzed string values (default: C). |
| 163 | + |
| 164 | + - **commitIntervalMsec**: `Long` |
| 165 | + |
| 166 | + Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, to disable use: 0). For the case where there are a lot of inserts/updates, a lower value, until commit, will cause the index not to account for them and memory usage would continue to grow. For the case where there are a few inserts/updates, a higher value will impact performance and waste disk space for each commit call without any added benefits. |
| 167 | + |
| 168 | + - **cleanupIntervalStep**: `Long` |
| 169 | + |
| 170 | + Wait at least this many commits between removing unused files in data directory (default: 10, to disable use: 0). For the case where the consolidation policies merge segments often (i.e. a lot of commit+consolidate), a lower value will cause a lot of disk space to be wasted. For the case where the consolidation policies rarely merge segments (i.e. few inserts/deletes), a higher value will impact performance without any added benefits. |
| 171 | + |
| 172 | + - **threshold**: `ConsolidateThreshold[]` |
| 173 | + |
| 174 | + A list of consolidate thresholds |
| 175 | + |
| 176 | + - **link**: `CollectionLink[]` |
| 177 | + |
| 178 | + A list of linked collections |
| 179 | + |
| 180 | +**Examples** |
| 181 | + |
| 182 | +```Java |
| 183 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 184 | +ArangoDatabase db = arango.db("myDB"); |
| 185 | +ArangoSearch view = db.arangoSearch("some-view"); |
| 186 | + |
| 187 | +view.replaceProperties(new ArangoSearchPropertiesOptions().link(CollectionLink.on("myCollection").fields(FieldLink.on("value").analyzers("identity")))); |
| 188 | +``` |
0 commit comments