You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,42 +24,46 @@ This quickstart demonstrates how to query using Lucene Index.
24
24
- Deploy an Azure Managed Instance for Apache Cassandra cluster. You can do this via the [portal](create-cluster-portal.md) - Lucene indexes will be enabled by default.
25
25
- Connect to your cluster from [CQLSH](https://learn.microsoft.com/en-us/azure/managed-instance-apache-cassandra/create-cluster-portal#connecting-from-cqlsh).
26
26
27
-
## Create a managed instance cluster
27
+
## Create keyspace and table
28
28
29
29
1. In your `CQLSH` command window, create a keyspace and table as below:
30
-
31
-
```SQL
32
-
CREATE KEYSPACE demo
33
-
WITH REPLICATION = {'class': 'NetworkTopologyStrategy', 'datacenter-1': 3};
34
-
USE demo;
35
-
CREATETABLEtweets (
36
-
id INTPRIMARY KEY,
37
-
user TEXT,
38
-
body TEXT,
39
-
timeTIMESTAMP,
40
-
latitude FLOAT,
41
-
longitude FLOAT
42
-
);
43
-
```
30
+
31
+
```SQL
32
+
CREATE KEYSPACE demo
33
+
WITH REPLICATION = {'class': 'NetworkTopologyStrategy', 'datacenter-1': 3};
34
+
USE demo;
35
+
CREATETABLEtweets (
36
+
id INTPRIMARY KEY,
37
+
user TEXT,
38
+
body TEXT,
39
+
timeTIMESTAMP,
40
+
latitude FLOAT,
41
+
longitude FLOAT
42
+
);
43
+
```
44
+
45
+
## Create custom secondary index using Lucene
44
46
45
47
1. Now create a custom secondary index on the table using Lucene Index:
@@ -71,92 +75,94 @@ This quickstart demonstrates how to query using Lucene Index.
71
75
INSERT INTO tweets (id,user,body,time,latitude,longitude) VALUES (5,'quetzal','Click my link, like my stuff!', '2023-04-01T11:21:59.001+0000', 40.3930, -3.7329);
72
76
```
73
77
78
+
## Search data
79
+
74
80
1. The index you created earlier will index all the columns in the table with the specified types, and it will be refreshed once per second. Alternatively, you can explicitly refresh all the index shards with an empty search with consistency ALL:
75
81
76
-
```SQL
77
-
CONSISTENCY ALL
78
-
SELECT*FROM tweets WHERE expr(tweets_index, '{refresh:true}');
79
-
CONSISTENCY QUORUM
80
-
```
82
+
```SQL
83
+
CONSISTENCY ALL
84
+
SELECT * FROM tweets WHERE expr(tweets_index, '{refresh:true}');
85
+
CONSISTENCY QUORUM
86
+
```
81
87
82
88
1. Now, you can search for tweets within a certain date range:
For more in-depth information and samples see [Stratio's Cassandra Lucene Index](https://github.com/Stratio/cassandra-lucene-index/blob/branch-3.0.14/doc/documentation.rst).
0 commit comments