ArangoDB Fulltext fails with dashes in search #4996
Comments
Looking at this closer, I might be using the Fulltext index erroneously... I could accomplish a similar use case using Contains or Like. Is there any significant performance difference in a Fulltext index versus using Contains or Like string functions, or benefit when using Fulltext and Contains/Like? |
LET phrase = "Cisco-IOS-XE"
FOR dp IN FULLTEXT(DataPath, "human_id", SUBSTITUTE(phrase, "-", ","), 10)
FILTER CONTAINS(dp.human_id, phrase)
RETURN dp.human_id Instead of searching for "Cisco" without "IOS" and "XE", the hyphen is substituted by a comma to create a search expression that finds "Cisco" and "IOS" and "XE". The returned subset of documents is filtered to ensure that the initial search phrase is contained literally (would eliminate e.g. Note that less than 10 results may be returned. You might want to remove the limit of 10 documents in the FULLTEXT() call and use LIMIT 10 above RETURN instead. Since you seem to be searching for prefixes in this particular case, there is an alternative approach: FOR dp IN DataPath
FILTER dp.human_id >= "Cisco-IOS-XE" AND dp.human_id < "Cisco-IOS-XF"
RETURN dp.human_id Create a skiplist index for |
Wonderful, thank you for the advice @Simran-B. This would be great information to add to the AQL docs. Will try and pull request later, closing in the meantime. |
we should leave that open, so it can be addressed in the documentation. |
It appears that ArangoDB Fulltext indexes fail to obtain results when a
-
is in the query parameter. This is not necessarily expected behavior based on the docs which do indicate that prefacing a search term with a-
indicates to ignore that result, but not detailed as within being an issue.Is there a way to "qualify" a search to indicate that dashes etc. should be part of the literal search?
Might be related to #2325
my environment running ArangoDB
I'm using the latest ArangoDB of the respective release series:
Mode:
Storage-Engine:
On this operating system:
this is an AQL-related issue:
[ ] I'm using graph features
I'm issuing AQL via:
I've run✅
db._explain("<my aql query>")
and it didn't shed more light on this.The AQL query in question is:
Actual:
Expected:
The issue can be reproduced using this dataset:
Not yet available. :( We can make this happen if necessary.
The text was updated successfully, but these errors were encountered: