Question about passing parameter list into full text index

(Mike Morley) #1

Greetings! Am attempting to pass a list of terms into the full text index to return nodes that have matching term text in order to generate category nodes for a search UX. I have tried a few different patterns, but am unable to use an unwind statement approach to iterate over the list term collection, as the call db.index.fulltext.queryNodes needs a literal parameter as an input, otherwise it returns a cast error:

Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure db.index.fulltext.queryNodes: Caused by: java.lang.ClassCastException: org.neo4j.kernel.api.schema.MultiTokenSchemaDescriptor cannot be cast to org.neo4j.kernel.api.impl.fulltext.FulltextSchemaDescriptor

I have tried a number of ways of doing this from lists, casting to string, etc. but no avail. This seems like it should be simple to do, but I am stuck/missing something... Any help would be appreciated.. thanks!
M>

Query:

:param categories =>
['Measles','IPC','Hand Hygiene','Fluoride','Oral Products','Ebola','Antibiotic','OSAP','Norovirus']

unwind $categories as category
with category
CALL db.index.fulltext.queryNodes("cardText", category) YIELD node, score
with node, category,score where score > .3
with category,node where not node in (node)-[:HAS_FACET]-(:Category)
merge (f:Facet:Category {Name:category})
ON CREATE set f.Uuid=apoc.create.uuid()
merge (node)-[:HAS_FACET]->(f)

0 Likes