user3395041
user3395041

Reputation: 455

Stratio cassandra-lucene-index plugin + BoundStatements

I just installed the Stratio cassandra-lucene-index Cassandra plugin.

Is it possible to use the Stratio cassandra-lucene-index via BoundStatements somehow ? Or Using the Builder is the closest as it can get ?

The reason I am asking is because I and looking to make my existing DAO layer, that is 100% based on BoundStatements, to use the Stratio cassandra-lucene-index and would like to continue using BoundStatements for many reasons: clarity, security and overall coding standardization within my application.

Thanks

Upvotes: 1

Views: 396

Answers (2)

Most documentation examples where recently updated to show how to search using BoundStatements and the Builder together.

I hope it helps.

Upvotes: 3

user3395041
user3395041

Reputation: 455

I found a example within the cassandra-lucene-index test source code CassandraUtils.java

    public List<Row> searchWithPreparedStatement(Search search) {
            String query = String.format("SELECT * FROM %s WHERE expr(%s,?) LIMIT %d", qualifiedTable, index, LIMIT);
            final PreparedStatement stmt = CassandraConnection.session.prepare(query);
            BoundStatement b = stmt.bind();
            b.setString(0, search.build());
            return execute(b).all();
    }

Upvotes: 1

Related Questions