DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

baid_manish_187433 avatar image
baid_manish_187433 asked ·

DSE Graph Solr Query limit not applied

Hi, We have a requirement where graphquery with solr filter return 1000 records.

By default, on server "cql_solr_query_paging: off" -- that limits the result to be restricted to 10 even when ".limit(1000)" is provided in gremlin query. Looks like limit provided in the gremlin query is not "pushed down" to the SOLR. Note: Limit with cql query is working as expected.

Question:

Is there a way where application can provide the "limit" if not in the gremlin query?

Tried "cql_solr_query_paging: driver", gremlin query is able to get results for ALL data but likely to result in bad performance since limit is not applied to solr queries. Here are the details:

Index: schema.vertexLabel('Account'). searchIndex(). ifNotExists(). by('nativeId').asString(). by('name').asText(). by('status'). by("ownerId"). by('metaType'). by('updateTime'). waitForIndex(5). create()

Schema schema.vertexLabel('Account'). ifNotExists(). partitionBy('tenantId', Ascii). partitionBy('appId', Ascii). partitionBy('nativeType', Ascii). clusterBy('entityKey', Text). property('ownerId',Ascii). property('entityGlobalId', Uuid). property('status', Ascii). property('metaType', Ascii). ... create()

Query: g.V(). hasLabel("Account"). has("tenantId", "Default"). has("appId", within("ABC")). has("nativeType", within("Account")). has("ownerId", "XYZ").limit(1000).profile()

Profile Output: Step Count Traversers Time (ms) % Dur ============================================================================================================= __.V().hasLabel("Account").has("appId",P.within... 2001 2001 972.929 86.51 CQL statements ordered by overall duration 371.242 _1=SELECT FROM "IAP"."Account" WHERE solr_query = '{"q":":", "fq":["appId:CAMR\-Finance25","nativeT ype:Account","tenantId:Default","ownerId:ARIHANTB"]}' LIMIT 2147483647* / Duration: 371 ms / Count: 1

Expected CQL Query: SELECT FROM "IAP"."Account" WHERE solr_query = '{"q":":*", "fq":["appId:CAMR\-Finance25","nativeType:Account","tenantId:Default","ownerId:ARIHANTB"]}' LIMIT 1000;

Looks like gremlin query "limit" is now applied while making SOLR queries.

graph
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

bettina.swynnerton avatar image
bettina.swynnerton answered ·

Hi @baid_manish_187433,

thank you for the detailed description, and apologies for the late response.

You are correct: In order for Search to work correctly with Graph, cql_solr_query_paging = driver needs to be set in the dse.yaml.

And yes, limit is not pushed down in the gremlin query.

I'll check if it makes sense to push it down and file an enhancement request.

Thanks!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.