# Full Text Search Very Slow in 4.1.0 as Compared to 3.15.14

**URL:** <https://community.neo4j.com/t/full-text-search-very-slow-in-4-1-0-as-compared-to-3-15-14/21842>\
**Category:** Neo4j Graph Platform\
**Created:** [July 17, 2020, 8:14pm UTC](https://community.neo4j.com/t/full-text-search-very-slow-in-4-1-0-as-compared-to-3-15-14/21842 "2020-07-17T20:14:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andy\_hegedus](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/andy_hegedus/32/18744_2.png) [@andy\_hegedus](https://community.neo4j.com/u/andy_hegedus)\
**Post date:** [July 17, 2020, 8:14pm UTC](https://community.neo4j.com/t/full-text-search-very-slow-in-4-1-0-as-compared-to-3-15-14/21842/1 "2020-07-17T20:14:11Z")

</div>

Hi,  
Since the upgrade of my database from 3.15.14 to 4.1.0 didn't work, I went ahead and recreated a new 4.1.0 database. I am noticing that the 4.1.0 full text search is significantly slower than 3.15.14. Less than a second as compared to ~20 sec which limits its usefulness. It was my intent to just reproduce what I had before, but in 4.1.0 so I could take advantage of the the latest gds procedures and not have different ones for different data sets.

Should I expect this radically different performance? And is there any way to improve it?

In 3.15.14 I have this schema  
Indexes  
ON :cpc(art) ONLINE  
ON :company(name) ONLINE (for uniqueness constraint)  
ON :cpc(cpcClass) ONLINE (for uniqueness constraint)  
ON :patent(patNum) ONLINE (for uniqueness constraint)  
Constraints  
ON ( company:company ) ASSERT company.name IS UNIQUE  
ON ( cpc:cpc ) ASSERT cpc.cpcClass IS UNIQUE  
ON ( patent:patent ) ASSERT patent.patNum IS UNIQUE

ANd in 4.1.0 I have this  
Index Name Type Uniqueness EntityType LabelsOrTypes Properties State  
constraint\_475f8f44 BTREE UNIQUE NODE ["company"] ["name"] ONLINE  
constraint\_5cd72616 BTREE UNIQUE NODE ["patent"] ["num"] ONLINE  
constraint\_f3b7a871 BTREE UNIQUE NODE ["cpc"] ["subgroup"] ONLINE  
cpcArt FULLTEXT NONUNIQUE NODE ["cpc"] ["art"] ONLINE  
Constraints  
ON ( company:company ) ASSERT (company.name) IS UNIQUE  
ON ( patent:patent ) ASSERT (patent.num) IS UNIQUE  
ON ( cpc:cpc ) ASSERT (cpc.subgroup) IS UNIQUE  
Note: I changed some property names to make more sense for the user. subgroup=cpcClass and patNum =num

Andy

---

<div class="post-metadata">

**Author:** ![mark.needham](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mark.needham/32/104_2.png) [@mark.needham](https://community.neo4j.com/u/mark.needham)\
**Post date:** [July 24, 2020, 2:35pm UTC](https://community.neo4j.com/t/full-text-search-very-slow-in-4-1-0-as-compared-to-3-15-14/21842/2 "2020-07-24T14:35:49Z")

</div>

Could you share examples of the queries that are running much slower in 4.1?

---

<div class="post-metadata">

**Author:** ![andy\_hegedus](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/andy_hegedus/32/18744_2.png) [@andy\_hegedus](https://community.neo4j.com/u/andy_hegedus)\
**Post date:** [July 24, 2020, 3:47pm UTC](https://community.neo4j.com/t/full-text-search-very-slow-in-4-1-0-as-compared-to-3-15-14/21842/3 "2020-07-24T15:47:16Z")

</div>

Hi,  
I will try to outline what is happening.  
I am focusing on Bloom. I run this query within Bloom with the 3.15.14 database and get results in 1.76 seconds

 ![version 3.15.14 bloom](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/2/2c08d0efb6adaf2fa383e6b3868d69e2a7082603.png)

In 4.1.0 I run this query and get results in 21.76 seconds

 ![version 4.1.0 bloom](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/0/0a4eb02f1fcec852b5a4a3c65f28d8fff0c1feef.png)

Digging deeper I think the index schemes may not be completely the same  
For 3.15.14 Database  
Indexes  
ON :cpc(art) ONLINE  
ON :company(name) ONLINE (for uniqueness constraint)  
ON :cpc(cpcClass) ONLINE (for uniqueness constraint)  
ON :patent(patNum) ONLINE (for uniqueness constraint)  
Constraints  
ON ( company:company ) ASSERT company.name IS UNIQUE  
ON ( cpc:cpc ) ASSERT cpc.cpcClass IS UNIQUE  
ON ( patent:patent ) ASSERT patent.patNum IS UNIQUE

Digging a bit deeper it appears that the cpc(Art) index is a node property and not listed as full text.  
{  
"description": "INDEX ON :cpc(art)",  
"indexName": "index\_22",  
"tokenNames": [  
"cpc"  
],  
"properties": [  
"art"  
],  
"state": "ONLINE",  
"type": "node\_label\_property",  
"progress": 100.0,  
"provider": {  
"version": "1.0",

And for the 4.1.0 I have  
Index Name Type Uniqueness EntityType LabelsOrTypes Properties State  
constraint\_475f8f44 BTREE UNIQUE NODE ["company"] ["name"] ONLINE  
constraint\_5cd72616 BTREE UNIQUE NODE ["patent"] ["num"] ONLINE  
constraint\_f3b7a871 BTREE UNIQUE NODE ["cpc"] ["subgroup"] ONLINE  
cpcArt FULLTEXT NONUNIQUE NODE ["cpc"] ["art"] ONLINE  
Constraints  
ON ( company:company ) ASSERT (company.name) IS UNIQUE  
ON ( patent:patent ) ASSERT (patent.num) IS UNIQUE  
ON ( cpc:cpc ) ASSERT (cpc.subgroup) IS UNIQUE

if I call queries within browser via cypher in 4.1.0 (note: I tried both ways of handling the text of the search)

CALL db.index.fulltext.queryNodes("cpcArt", ""atomic layer deposition"") YIELD node RETURN node.subgroup  
**Started streaming 3 records after 3 ms and completed after 40 ms**

CALL db.index.fulltext.queryNodes("cpcArt", "atomic layer deposition") YIELD node RETURN node.subgroup  
**Started streaming 2107 records after 3 ms and completed after 6 ms, displaying first 1000 rows.**  
The results are much faster as compared to the Bloom results.  
Andy
