Hi,
assume you have the following record:
#1:1, "houston, texas, united states"
If there is no index the semantics of CONTAINSTEXT will iterate over all the records returning only those wich contains the substring, hence:
SELECT FROM V WHERE txt CONTAINSTEXT "united s"
will return: #1:1
If there is a FULLTEXT index it will contain something like:
"houston", #1:1"texas", #1:1"united", #1:1"states", #1:1
In this case when you use the CONTAINSTEXT operator, orientdb will search the existence of your query string as a key over the FULLTEXT index, hence:
SELECT FROM V WHERE txt CONTAINSTEXT "united s"
will return: NOTHING (since in the index there isn't any key equals to "united s")
SELECT FROM V WHERE txt CONTAINSTEXT "united"
will return: #1:1
If you have a FULLTEXT index you can always search a substring, with LIKE operator:
SELECT FROM V WHERE txt like "%united s%"
will return: #1:1
But remember than in this case you wouldn't benefit of the index.
Cheers,
Riccardo