cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

LOAD CSV and lucenbe call have a strange behavior when used together

paolodipietro58
Graph Voyager

Hi all,

I have the following short query, which reads a 40.000 lines input files, but suddenly stops after the first line.

 

 

LOAD CSV WITH HEADERS 
FROM 'file:///Customers/data.csv" as row FIELDTERMINATOR ';'

    WITH row, trim(row.`nome del produttore`) AS ProducerName
        WHERE row.uuid <> "" AND ProducerName <> ""

    CALL db.index.fulltext.queryNodes("Producer_name", ProducerName) YIELD node, score

    WITH row, ProducerName, node, score 
        LIMIT 3

    RETURN linenumber(), node.name, ProducerName, score

 

 

The result is just the 3 lines from `limit 3 but related only at the first record in LOAD CSV`paolodipietro58_0-1655029744150.png

Can anyone help me to understand why it doesn't read all the entire file? Apart for the ````lucene` call, it is a simple `load CSV`

1 REPLY 1

glilienfield
Ninja
Ninja

The full text query is returning multiple results, so the line 2 row results in 3 or more records. Your limit stops the output at 3 rows total, so all other subsequent rows will be filtered out. 

Are you trying to limit the result of the full text search to 3 rows for each search? The way it is written, it is a limit of 3 for the entire query. You could wrap the call to full text in a call subquery and limit it return to 3 rows to achieve a limit per full text call