Fulltext
If a fulltext index exists, then
/_api/simple/fulltext
will use this index to execute the specified fulltext query.
Create fulltext index
creates a fulltext index
POST /_api/index#fulltext
Query Parameters
- collection (required): The collection name.
A JSON object with these properties is required:
-
type: must be equal to “fulltext”.
-
fields: an array of attribute names. Currently, the array is limited to exactly one attribute.
-
minLength: Minimum character length of words to index. Will default to a server-defined value if unspecified. It is thus recommended to set this value explicitly when creating the index.
Creates a fulltext index for the collection collection-name, if it does not already exist. The call expects an object containing the index details.
Return codes
-
200: If the index already exists, then a HTTP 200 is returned.
-
201: If the index does not already exist and could be created, then a HTTP 201 is returned.
-
404: If the collection-name is unknown, then a HTTP 404 is returned.
Examples
Creating a fulltext index
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/index?collection=products <<EOF
{
"type" : "fulltext",
"fields" : [
"text"
]
}
EOF
HTTP/1.1 201 Created
content-type: application/json
connection: Keep-Alive
content-length: 182
server: ArangoDB
x-content-type-options: nosniff